- priority: 1 --> 3
When selecting objects, there are a lot of referred objects to select. When referred objects are encountered, they are always re-selected, because each object will be a separate instance.
There should be an object cache in addition to the result cache, which would keep track of current object (marshalled) values. Then, before a referred object is declared 'missing attribute', it should be searched in the object cache first.
Also, the result cache could just point to object cache ids instead of caching the values itself.
Additionally a cache update event should include which object specifically changed, this way the cache could compute a more informed decision which entries should be removed, instead removing all entries to a class.
The cache update event in this case could contain the ids of the changed objects, instead of the classes. The classes can be cached keyed with the ids in the object cache.