Add map preview cache
Nightly build for this pull request:
- artifacts-YR.zip
- artifacts-TS.zip
- artifacts-Ares.zip This comment is automatic and is meant to allow guests to get latest automatic builds without registering. It is updated on every successful build.
Actually hold on, maybe it would be better to use something like a weak reference for the cache instead of manually doing it?
Also I am not sure if clearing all of the maps when the limit is reached is a good idea, I would shave off the not used ones. Some maps are going to appear more frequently so they won't be deleted.
Thanks for letting me know WeakReference. Will investigate
... I would shave off the not used ones. Some maps are going to appear more frequently so they won't be deleted.
LRU.
... I would shave off the not used ones. Some maps are going to appear more frequently so they won't be deleted.
LRU.
I would prefer leaving GC to decide using WeakReference
No, he has a point. GC doesn't care about time of last use, but we do. LRU cache seems to be a common technique and an effective measure for keeping only actually used things in memory, so why not?
No, he has a point. GC doesn't care about time of last use, but we do. LRU cache seems to be a common technique and an effective measure for keeping only actually used things in memory, so why not?
Okay. I just searched and find out WeakReference will be cleared out at every collection. Will implement an LRU