@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, 1024> stack_;
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
 
@@ -84,6 +84,8 @@
84
84
  "ROCKSDB_RANGESYNC_PRESENT=1",
85
85
  "ROCKSDB_SCHED_GETCPU_PRESENT=1",
86
86
  "ROCKSDB_IOURING_PRESENT=1",
87
+ # "ROCKSDB_JEMALLOC=1",
88
+ # "JEMALLOC_NO_DEMANGLE=1",
87
89
  "HAVE_SSE42=1",
88
90
  "HAVE_BMI=1",
89
91
  "HAVE_LZCNT=1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/rocksdb",
3
- "version": "5.2.38",
3
+ "version": "5.2.39",
4
4
  "description": "A low-level Node.js RocksDB binding",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
Binary file