Open bompus opened 3 hours ago
import createMnemonistLruCache from 'mnemonist/lru-cache.js';
Is createMnemonistLruCache
is an normal LRU cache implementation ??
if yes can you please the implementation of mnemonist/lru-cache.js ??
@RADHAsakthivel docs for mnemonist/lru-cache. I just had to add the .js extension to prevent Node.js throwing an error saying it can't find the import.
What version of Bun is running?
1.1.29+6d43b3662
What platform is your computer?
Ubuntu 24.04.1 LTS Linux 6.10.7-x64v3-xanmod1 x86_64 x86_64
What steps can reproduce the bug?
$ bun add mitata flru lru.min lru-cache mnemonist
$ bun lru-cache-mitata.js && node lru-cache-mitata.js
What is the expected behavior?
I would expect Bun to be comparable or faster than Node.js
This could be an underlying JSC issue, but either way, it's an significant difference.
flru is much simpler, and the difference there is only 25%, but the other packages are roughly 1800-3600% slower in Bun for cache eviction, depending on what benchmarking library is used. I tested initially using tinybench, then with mitata to confirm.
What do you see instead?
$ bun --revision # 1.1.29+6d43b3662
$ bun lru-cache-mitata.js
$ node -v # v22.9.0
$ node lru-cache-mitata.js
Additional information
No response