Open ldmoser opened 10 years ago
I think we should generalise this ticket to be about LRUCache performance in general, particularly with respect to threading - some of my Gaffer profiles are beginning to suggest we have some overheads there.
It may not be related but to this issue, but I believe that we will need to have a more reliable way to compute memory usage from objects in a cache to prevent double counting data that is shared and reporting wrong information. I guess we need some sort of context object that is passed to the memoryUsage in similar way as the LoadContext for Object..
Issue #205 is all about that very thing - and the protected Object::MemoryAccumulator class is already some way to being the context object you're talking about.
As we rely more on the LRUCache, I believe would be beneficial to use associative maps with constant access time for find operations. Should also pay attention to memory consumption. Consider passing the map to be used as a template parameter as well.