eclipse-viatra / org.eclipse.viatra

Main components of the VIATRA framework
https://eclipse.dev/viatra
Eclipse Public License 2.0
0 stars 1 forks source link

Refactor Base Index instance store collections (cont'd) #74

Open eclipse-viatra-bot opened 5 months ago

eclipse-viatra-bot commented 5 months ago

| --- | --- | | Bugzilla Link | 526801 | | Status | NEW | | Importance | P3 normal | | Reported | Nov 03, 2017 06:16 EDT | | Modified | Nov 26, 2018 07:58 EDT | | Version | 1.7.0 | | Blocks | 398762 | | Reporter | Gabor Bergmann |

Description

Following up on Bug 521206, consider these memory reduction ideas:

  1. Specialize for more efficient storage of ( a ) to-one features ( b ) unique to-many features ( c ) eOpposites.

  2. Currently, for any given indexed feature, the value-to-holder map is always constructed, while the holder-to-value map is inverted (without EMF retraversal) from it on demand. There are cases where LS (or in the hopeful future Rete) would only need the latter kind of lookup, not the former. In these cases persistent memory would be cut in half if backends had more direct control over which direction of indexing they prefer for a given feature.

  3. "Lean indexer" deduplication with model: There should be a "lean indexer mode" base index option where the forward navigating map (feature value to feature holder) is never built (not even on demand), but is instead served by delegating to a "holders" set and especially the underlying EMF model using eGet(). Further savings possible in case of EReferences with eOpposites, where neither the forward nor the backward map is necessary to construct, and we can rely entirely on eGet() calls in both direction.

Note of caution: this should definitely be an option, not mandatory. Also, not compatible with Rete input indexer deduplication until proper notification timings etc. are implemented.

See experiment here: https://git.eclipse.org/r/#/c/106423

  1. Finally, support deduplication with Rete input indexers, tracked in Bug 398762. (Might be tricky to get the update timings right, and may involve an interface refactor.)