classic-level icon indicating copy to clipboard operation
classic-level copied to clipboard

Breaking: bump `abstract-level` to 2.0.0

Open vweevers opened this issue 2 years ago • 5 comments

TODO:

  • [x] Pass abstract test suite
  • [x] Update additional tests
  • [x] Update types
  • [x] Cleanup the closing of iterators (see TODO comments in binding)
  • [x] Update docs
  • [x] Write upgrade guide
  • [x] Create snapshot for get() synchronously (https://github.com/Level/community/issues/118)
  • [x] Support signal option on iterators
  • [ ] Benchmark (optional):
    • [ ] get() concurrently, to see if synchronous snapshot blocks event loop
    • [ ] iterator(), to compare callbacks vs promises
    • [ ] put(), to compare callbacks vs promises

To be rebased (not fully squashed) before merge.

vweevers avatar Nov 18 '22 14:11 vweevers

Hey, when do you plan to merge/release v2? Looking forward to it, thanks!

ishfx avatar Mar 04 '24 10:03 ishfx

@vweevers would you like some help with benchmarking?

jacoscaz avatar Mar 29 '24 08:03 jacoscaz

Help is always welcome, thank you! Though FYI, that's not why I haven't released this yet. Just haven't had the time, and I don't consider benchmarks to be a blocker (because e.g. promises are unlikely to make a big difference here) so I planned to just skip them when I got to it.

The only thing that slightly worries me is that db.get() now creates a snapshot synchronously. I don't know if that's a fast operation for LevelDB.

vweevers avatar Mar 29 '24 08:03 vweevers

@vweevers no pressure meant or implied. I depend on level packages through quadstore and I'd be happy to help an upstream dependency if I can find the time.

Also, my experience with promise-based iteration is exactly the opposite; so far I've always found it to make a rather big difference, particularly with asynchronous sources capable of reading and returning multiple items in batches and particularly when structuring chains of iterators. That said, I also recognize that I'm not as experienced as you are. I'll have a look next week!

jacoscaz avatar Mar 29 '24 08:03 jacoscaz

I'm not that experienced with promises themselves, I meant more that disk and the C<>JS barrier are the bigger bottlenecks here. But it's always good to challenge such assumptions. You're probably right that there's an overhead to e.g. async iterators.

For people that were already using promises, I do hope that abstract-level v2 and classic-level v2 are faster because they no longer have to translate callbacks into promises, allowing V8 to optimize it.

vweevers avatar Mar 29 '24 09:03 vweevers