Conversation
|
Thanks @kurtextrem. I will merge your PR as soon as I start working on the SIEVE cache. It's just that I am swamped currently. |
|
no worries, take your time. |
|
@kurtextrem I'm probably doing something wrong in my benchmark. Running this implementation of SieveMap I'm seeing much worse hit ratio compared to your js-sieve implementation, my own simple Sieve implementation, or mnemonist/lru-map. Output of hit % on a sample K/V trace. Sample code for the above can be found here: https://github.com/NeoPhi/cache-playground |
|
@NeoPhi Cool stuff, thank you for doing this! The differences in hit ratio are surprising to me, but I can't really tell you what's off. I took the example code referenced by the sieve paper and fixed some JS errors (#212 (comment)). |
|
I'm relying heavily on the iterator semantics of the JS Map. I think the proposed code changes linked to from #212 (comment) are buggy. I tried a simple use case and it looks like the internal data structures are getting corrupted: |
As I've prepared the code based on the LRU data structure from mnemonist already for my own purposes, I figured I'd open a draft PR so anyone can take a look or do further improvements/iterations on the code (or tests with it).
As written in #212, in my benchmark, the
Map()implementation comes out on top (with strings as keys).