-
-
Notifications
You must be signed in to change notification settings - Fork 56
Rewrite to N-API #111
Rewrite to N-API #111
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. LGTM!
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Source code alone, package size is 1.8 MB, 8.5 MB unpacked. With prebuilds, the package size is 5.9 MB, 19.5 MB unpacked.
(side note: I |
Benchmark code available here. With some npm magic you can install
Repeat the last 3 steps for the other benchmarks (
Last note: you don't have to npm-install Results on Windows (TLDR: we're good, though we don't have read benchmarks yet): |
More benchmarks are welcome, post results here! In the mean time I'm merging this. |
Closes #100. Though this looks like a big PR, there's not much code to review because I copied large parts from
leveldown
. That includesbinding.cc
and all JS files including tests (rocksdb
has only one test of its own:open-read-only-test.js
). The differences betweenleveldown
androcksdb
are recorded in 3433541, 7a5547b and bcdd317.Prebuilds
Like
leveldown
,rocksdb
now usesprebuildify
which means prebuilds will be included in the npm package. Unlikeleveldown
,rocksdb
does not make prebuilds for ARM, Android or Alpine (until someone requests them, I figured) (and on RPi and mobile you're better off with RocksDBLite). After initial review of this PR I'll trigger CI to make prebuilds, so we can check what the total npm package size will be.Additional changes
cacheSize
is0
, rather than using a block cache with RocksDB's default sizeverify_checksums
to false (same asleveldown
/ LevelDB) (Support checksum options leveldown#172 (comment))leveldown
/ LevelDB)info_log_level
fromINFO_LEVEL
toWARN_LEVEL
Performance
The leak tests (
node --expose-gc test/leak-tester[-batch]
) show memory growth but I get the same results onmaster
(I used node 10.14.1 on both) so it might be a preexisting leak or natural RocksDB growth.I want to run benchmarks as well; perhaps by extracting the benchmarks from
leveldown
into a standalone tool that can target anyabstract-leveldown
implementation.