Welcome! Log In Create A New Profile


[PHP-DEV] Internal LRU cache implementation

Posted by Josh Di Fabio 
Josh Di Fabio
[PHP-DEV] Internal LRU cache implementation
August 01, 2018 11:40AM
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

PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
Sorry, only registered users may post in this forum.

Click here to login