Closed mhart closed 10 years ago
lgtm, also if you already have a benchmark script and could at it, that would be killer!
tests are probably failing because I've neglected to merge and release this https://github.com/rvagg/abstract-leveldown/pull/21
Unfortunately no direct benchmark I'm afraid - I was using this: https://github.com/mhart/dynalite/blob/master/test/bench.js - which writes to levelup behind the scenes (1m items - that still doesn't return in a reasonable time on memdown, but even 10k was struggling whereas now it's fine)
added @mhart as collaborator, will get the tests running then publish
Added some vague benchmarks comparing the old and new strategies here: https://github.com/rvagg/memdown/pull/8
Doesn't directly measure _put
and _delete
as I wasn't really sure how you'd prefer to benchmark the old lib vs the new one.
This results in a ~60x speed increase when dealing with thousands of items.
(it was taking 120s to insert only 10,000 items!)
Things still start to slow down a fair bit when dealing with >100k items, but you'd need to move to another data structure to support this I suspect (lsm-tree perhaps?)
I was considering making this a "private" function on the MemDOWN prototype, but wasn't sure that it really fit in with the other DB-related functions.
Also - the tests are failing - but they're the exact same ones that are failing on current master anyway...