@lemarkar I tried to include GitHub - emar-kar/cache and it worked, but it was too slow like 9 times or something, so I had to take it out. I am sure it’s good for something, and maybe I used it wrong? I mean it has many options I don’t need.
It never meant to be fast. It’s not optimized for high load and is just some useful api for default map. I just hoped to see the numbers, but thank you for trying it anyway
I checked the test code and can explain why it fails so pathetically out of the box. Since it allows to store any, I used gob for size evaluation. It seemed more universal but comes with a cost of encoding. Since in your experiment you are using only [ ]byte you can set size fn via options to return just the length of the content. In this case it can compete a little bit more fare. And since there is no displacement method inside, I’d advise to remove size limitation, or at some point it will just start to through errors, that the size limit was exceeded without adding new items. I tested it with your benchmark locally and it was not that bad