rocksdb/java/rocksjni
Chen Shen 78cb6b6112 Provide byte[] version of SstFileWriter.merge to reduce GC Stall
Summary:
In Java API, `SstFileWriter.put/merge/delete` takes `Slice` type of key and value, which is a Java wrapper object around C++ Slice object.  The Slice object inherited [ `finalize`](3c327ac2d0/java/src/main/java/org/rocksdb/AbstractNativeReference.java (L69)) method, which [added huge overhead](https://softwareengineering.stackexchange.com/questions/288715/is-overriding-object-finalize-really-bad/288753#288753) to JVM while creating new SstFile.

To address this issue, this PR overload the merge method to take Java byte array instead of the Slice object, and added unit test for it.

We also benchmark these two different merge function, where we could see GC Stall reduced from 50%  to 1%, and the throughput increased from 50MB to 200MB.
Closes https://github.com/facebook/rocksdb/pull/2746

Reviewed By: sagar0

Differential Revision: D5653145

Pulled By: scv119

fbshipit-source-id: b55ea58554b573d0b1c6f6170f8d9223811bc4f5
2017-08-22 12:55:24 -07:00
..
backupablejni.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
backupenginejni.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
cassandra_compactionfilterjni.cc Cassandra compaction filter for purge expired columns and rows 2017-07-21 14:57:44 -07:00
cassandra_value_operator.cc Fix license headers in Cassandra related files 2017-07-28 13:56:56 -07:00
checkpoint.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
clock_cache.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
columnfamilyhandle.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
compaction_filter.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
compaction_options_fifo.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
compaction_options_universal.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
comparator.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
comparatorjnicallback.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
comparatorjnicallback.h Change RocksDB License 2017-07-15 16:11:23 -07:00
compression_options.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
env_options.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
env.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
filter.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
ingest_external_file_options.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
iterator.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
loggerjnicallback.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
loggerjnicallback.h Change RocksDB License 2017-07-15 16:11:23 -07:00
lru_cache.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
memtablejni.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
merge_operator.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
options.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
portal.h Change RocksDB License 2017-07-15 16:11:23 -07:00
ratelimiterjni.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
remove_emptyvalue_compactionfilterjni.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
restorejni.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
rocksdb_exception_test.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
rocksjni.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
slice.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
snapshot.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
sst_file_writerjni.cc Provide byte[] version of SstFileWriter.merge to reduce GC Stall 2017-08-22 12:55:24 -07:00
statistics.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
statisticsjni.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
statisticsjni.h Change RocksDB License 2017-07-15 16:11:23 -07:00
table.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
transaction_log.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
ttl.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
write_batch_test.cc Gcc 7 ParsedInternalKey replace memset with clear function. 2017-07-24 11:31:15 -07:00
write_batch_with_index.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
write_batch.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
writebatchhandlerjnicallback.cc Change RocksDB License 2017-07-15 16:11:23 -07:00
writebatchhandlerjnicallback.h Change RocksDB License 2017-07-15 16:11:23 -07:00