Bug 509667 - [evaluator] Optimize select
Summary: [evaluator] Optimize select
Status: NEW
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: OCL Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 509668 509842
  Show dependency tree
 
Reported: 2016-12-23 04:17 EST by Ed Willink CLA
Modified: 2017-01-03 04:55 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2016-12-23 04:17:35 EST
An evaluation such as

  aCollection->select(p | p... = ...)

is a lookup of the p... key of aCollection.

Since all p... need evaluating, caching the mapping incurs moderate cost.

If there is any likelihood that the evaluation is repeated for another key, the saving can be significant.

For QVT a re-evaluation is very likely. For OCL it might be worth examining the ancestry of the select to see if it is locally repeated. However for other applications such as validation, the repeat may not be obvious. Is it worth assuming re-evaluation always?

Also applicable to reject and exploitable by one, any.