@nxtedition/rocksdb 5.2.38 → 5.2.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/binding.cc
CHANGED
|
@@ -221,7 +221,7 @@ napi_status Convert(napi_env env, rocksdb::PinnableSlice s, bool asBuffer, napi_
|
|
|
221
221
|
|
|
222
222
|
struct NapiSlice : public rocksdb::Slice {
|
|
223
223
|
std::unique_ptr<char[]> heap_;
|
|
224
|
-
std::array<char,
|
|
224
|
+
std::array<char, 128> stack_;
|
|
225
225
|
};
|
|
226
226
|
|
|
227
227
|
napi_status ToNapiSlice(napi_env env, napi_value from, NapiSlice& slice) {
|
|
@@ -602,6 +602,7 @@ NAPI_METHOD(db_open) {
|
|
|
602
602
|
: rocksdb::kNoCompression;
|
|
603
603
|
options.use_adaptive_mutex = true;
|
|
604
604
|
options.enable_pipelined_write = true;
|
|
605
|
+
options.max_background_jobs = std::thread::hardware_concurrency() / 4;
|
|
605
606
|
|
|
606
607
|
// TODO: Consider direct IO (https://github.com/facebook/rocksdb/wiki/Direct-IO) once
|
|
607
608
|
// secondary compressed cache is stable.
|
|
@@ -640,8 +641,10 @@ NAPI_METHOD(db_open) {
|
|
|
640
641
|
|
|
641
642
|
if (cacheSize) {
|
|
642
643
|
tableOptions.block_cache = rocksdb::NewLRUCache(cacheSize);
|
|
644
|
+
tableOptions.cache_index_and_filter_blocks = BooleanProperty(env, argv[2], "cacheIndexAndFilterBlocks").value_or(true);
|
|
643
645
|
} else {
|
|
644
646
|
tableOptions.no_block_cache = true;
|
|
647
|
+
tableOptions.cache_index_and_filter_blocks = false;
|
|
645
648
|
}
|
|
646
649
|
|
|
647
650
|
tableOptions.block_size = Uint32Property(env, argv[2], "blockSize").value_or(4096);
|
|
@@ -650,7 +653,6 @@ NAPI_METHOD(db_open) {
|
|
|
650
653
|
tableOptions.format_version = 5;
|
|
651
654
|
tableOptions.checksum = rocksdb::kXXH3;
|
|
652
655
|
tableOptions.optimize_filters_for_memory = BooleanProperty(env, argv[2], "optimizeFiltersForMemory").value_or(true);
|
|
653
|
-
tableOptions.cache_index_and_filter_blocks = BooleanProperty(env, argv[2], "cacheIndexAndFilterBlocks").value_or(true);
|
|
654
656
|
|
|
655
657
|
options.table_factory.reset(rocksdb::NewBlockBasedTableFactory(tableOptions));
|
|
656
658
|
|
package/deps/rocksdb/rocksdb.gyp
CHANGED
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|