2 ms·
A tangentially related optimization: When you read a value from a collection, move it towards the front. Requires that order not be important, of course. Ditt
by TheLoneWolfling 11y ago
A tangentially related optimization:
When you read a value from a collection, move it towards the front.
Requires that order not be important, of course. Ditto, it's more trouble than it's generally worth if you're doing any sort of multithreading, or if you're using something where writes are much slower than reads.
It's also handy for most hash tables. (Though generally you should be using a Cuckoo hashtable anyways)