ImageEngine / cortex

Libraries for visual effects software development
Other
531 stars 124 forks source link

LRUCache with constant access time #225

Open ldmoser opened 10 years ago

ldmoser commented 10 years ago

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.

johnhaddon commented 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.

ldmoser commented 10 years ago

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..

johnhaddon commented 10 years ago

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.