Internal LRU cache implementation
| From: | Josh Di Fabio | Date: | Wed, 01 Aug 2018 09:29:10 +0000 |
| Subject: | Internal LRU cache implementation | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-103006@lists.php.net to get a copy of this message | ||
Hello internals,
In my experience, LRU cache is a common pattern in userland. Each time
I write one in PHP, I suspect that it would probably be much more
efficient if it was implemented in C.
If this is indeed a very common pattern, and it would be much more
efficient implemented internally, is there any appetite for an
internal implementation of LRU cache?
I would suggest the following interface as a starting point:
__construct(int size)
resize(int n)
get(scalar key)
set(scalar key, value)
remove(scalar key)
Thanks for your time