-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
-
False
-
-
False
-
-
When using the hybrid mining strategy, a cache is used to map object identifiers to specific relational tables in the in-memory relational model. While this cache already maintains a LRU cache of recently looked up entries, this lookup is quite costly, as shown here:
Benchmark Mode Cnt Score Error Units ObjectIdCacheLookupPerfTest.noPriorResultCache thrpt 10 468.353 ± 10.631 ops/us ObjectIdCacheLookupPerfTest.priorResultCache thrpt 10 1764.071 ± 3.905 ops/us
I propose we introduce a new member variable that tracks the last objectId and dataObjectId lookup and the resulting TableId. When the cache is consulted, we first check this last value using something like this:
if (lastLookup != null && objectId.equals(lastLookup.objectId()) && Objects.equals(lastLookup.dataObjectId(), dataObjectId)) { return lastLookup.tableId() == NO_SUCH_TABLE ? null : lastLookup.tableId(); }
This avoids the LRUMap lookup all together if the prior lookup was for the same objectId and dataObjectId and clearly provides a 4.5x speed increase based on the current code.