rocksdb/table
Islam AbdelRahman d9bca1e14c Reduce iterator deletion overhead
Summary:
After introducing Iterator::PinData(), we have extra overhead of deleting the pinned iterators that we track in a std::set
This patch avoid inserting to the std::set if we have only one iterator (normal use case when no iterators are pinned)

Before this change
```
DEBUG_LEVEL=0 make db_bench -j64 && ./db_bench --benchmarks="newiterator" --db="/tmp/rocksdbtest-8616/dbbench" --use_existing_db --disable_auto_compactions
newiterator  :       1.006 micros/op 994013 ops/sec;
newiterator  :       0.994 micros/op 1006295 ops/sec;
newiterator  :       0.990 micros/op 1010422 ops/sec;
```

After change

```
DEBUG_LEVEL=0 make db_bench -j64 && ./db_bench --benchmarks="newiterator" --db="/tmp/rocksdbtest-8616/dbbench" --use_existing_db --disable_auto_compactions
newiterator  :       0.754 micros/op 1326588 ops/sec;
newiterator  :       0.759 micros/op 1317394 ops/sec;
newiterator  :       0.691 micros/op 1446704 ops/sec;
```

Test Plan: make check -j64

Reviewers: yhchiang, rven, anthony, sdong

Reviewed By: sdong

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D52761
2016-01-11 16:48:15 -08:00
..
adaptive_table_factory.cc Pass column family ID to table property collector 2015-10-09 14:36:51 -07:00
adaptive_table_factory.h Pass column family ID to table property collector 2015-10-09 14:36:51 -07:00
block.cc Introduce ReadOptions::pin_data (support zero copy for keys) 2015-12-16 12:08:30 -08:00
block.h Introduce ReadOptions::pin_data (support zero copy for keys) 2015-12-16 12:08:30 -08:00
block_based_filter_block.cc Revert "Fixed the bug when both whole_key_filtering and prefix_extractor are set." 2016-01-06 23:33:41 -08:00
block_based_filter_block.h Revert "Fixed the bug when both whole_key_filtering and prefix_extractor are set." 2016-01-06 23:33:41 -08:00
block_based_filter_block_test.cc
block_based_table_builder.cc Introduce ReadOptions::pin_data (support zero copy for keys) 2015-12-16 12:08:30 -08:00
block_based_table_builder.h Move skip_table_builder_flush to BlockBasedTableOption 2015-10-30 18:33:01 -07:00
block_based_table_factory.cc Prevent the user from setting block_restart_interval to less than 1 2016-01-04 14:13:18 -08:00
block_based_table_factory.h Merge pull request #805 from SherlockNoMad/OptionHelperFix 2015-11-17 16:24:52 -08:00
block_based_table_reader.cc Fix index seeking in BlockTableReader::PrefixMayMatch. 2016-01-06 16:39:56 -05:00
block_based_table_reader.h Skip bottom-level filter block caching when hit-optimized 2015-12-23 10:15:07 -08:00
block_builder.cc Introduce ReadOptions::pin_data (support zero copy for keys) 2015-12-16 12:08:30 -08:00
block_builder.h Introduce ReadOptions::pin_data (support zero copy for keys) 2015-12-16 12:08:30 -08:00
block_hash_index.cc Seperate InternalIterator from Iterator 2015-10-13 15:32:13 -07:00
block_hash_index.h Seperate InternalIterator from Iterator 2015-10-13 15:32:13 -07:00
block_hash_index_test.cc Seperate InternalIterator from Iterator 2015-10-13 15:32:13 -07:00
block_prefix_index.cc
block_prefix_index.h
block_test.cc Seperate InternalIterator from Iterator 2015-10-13 15:32:13 -07:00
bloom_block.cc
bloom_block.h
cuckoo_table_builder.cc Merge pull request #846 from yuslepukhin/enble_c4244_lossofdata 2015-12-23 22:59:42 -08:00
cuckoo_table_builder.h Move rate_limiter, write buffering, most perf context instrumentation and most random kill out of Env 2015-07-17 16:58:18 -07:00
cuckoo_table_builder_test.cc Enable MS compiler warning c4244. 2015-12-11 16:47:34 -08:00
cuckoo_table_factory.cc Pass column family ID to table property collector 2015-10-09 14:36:51 -07:00
cuckoo_table_factory.h Add OptionsUtil::LoadOptionsFromFile() API 2015-11-12 06:52:43 -08:00
cuckoo_table_reader.cc Skip bottom-level filter block caching when hit-optimized 2015-12-23 10:15:07 -08:00
cuckoo_table_reader.h Skip bottom-level filter block caching when hit-optimized 2015-12-23 10:15:07 -08:00
cuckoo_table_reader_test.cc Enable MS compiler warning c4244. 2015-12-11 16:47:34 -08:00
filter_block.h
flush_block_policy.cc
format.cc Add ZSTD (not final format) compression type 2015-08-28 11:01:13 -07:00
format.h Move rate_limiter, write buffering, most perf context instrumentation and most random kill out of Env 2015-07-17 16:58:18 -07:00
full_filter_block.cc bloom hit/miss stats for SST and memtable 2015-10-07 11:23:20 -07:00
full_filter_block.h
full_filter_block_test.cc
get_context.cc Optimize GetLatestSequenceForKey 2016-01-06 13:43:22 -08:00
get_context.h Use SST files for Transaction conflict detection 2015-12-11 12:34:11 -08:00
internal_iterator.h Introduce ReadOptions::pin_data (support zero copy for keys) 2015-12-16 12:08:30 -08:00
iter_heap.h
iterator.cc Seperate InternalIterator from Iterator 2015-10-13 15:32:13 -07:00
iterator_wrapper.h Reduce iterator deletion overhead 2016-01-11 16:48:15 -08:00
merger.cc Introduce ReadOptions::pin_data (support zero copy for keys) 2015-12-16 12:08:30 -08:00
merger.h Seperate InternalIterator from Iterator 2015-10-13 15:32:13 -07:00
merger_test.cc Seperate InternalIterator from Iterator 2015-10-13 15:32:13 -07:00
meta_blocks.cc Revert "Adding new table properties" 2015-11-06 16:49:38 -08:00
meta_blocks.h Moving memtable related files from util to a new directory memtable 2015-10-16 14:10:33 -07:00
mock_table.cc Skip bottom-level filter block caching when hit-optimized 2015-12-23 10:15:07 -08:00
mock_table.h Skip bottom-level filter block caching when hit-optimized 2015-12-23 10:15:07 -08:00
plain_table_builder.cc Pass column family ID to table property collector 2015-10-09 14:36:51 -07:00
plain_table_builder.h Pass column family ID to table property collector 2015-10-09 14:36:51 -07:00
plain_table_factory.cc Merge pull request #805 from SherlockNoMad/OptionHelperFix 2015-11-17 16:24:52 -08:00
plain_table_factory.h Fix build broken by previous commit of "option helper refactor" 2015-11-17 16:52:54 -08:00
plain_table_index.cc Enable MS compiler warning c4244. 2015-12-11 16:47:34 -08:00
plain_table_index.h
plain_table_key_coding.cc plain table reader: non-mmap mode to keep two recent buffers 2016-01-08 10:53:57 -08:00
plain_table_key_coding.h Include <array> in table/plain_table_key_coding.h 2016-01-08 17:34:53 -08:00
plain_table_reader.cc Skip bottom-level filter block caching when hit-optimized 2015-12-23 10:15:07 -08:00
plain_table_reader.h Skip bottom-level filter block caching when hit-optimized 2015-12-23 10:15:07 -08:00
scoped_arena_iterator.h Seperate InternalIterator from Iterator 2015-10-13 15:32:13 -07:00
sst_file_writer.cc Move skip_table_builder_flush to BlockBasedTableOption 2015-10-30 18:33:01 -07:00
table_builder.h Skip bottom-level filter block caching when hit-optimized 2015-12-23 10:15:07 -08:00
table_properties.cc Revert "Adding new table properties" 2015-11-06 16:49:38 -08:00
table_properties_internal.h Seperate InternalIterator from Iterator 2015-10-13 15:32:13 -07:00
table_reader.h Skip bottom-level filter block caching when hit-optimized 2015-12-23 10:15:07 -08:00
table_reader_bench.cc plain table reader: non-mmap mode to keep two recent buffers 2016-01-08 10:53:57 -08:00
table_test.cc Fix BlockBasedTableTest.NoopTransformSeek failure 2016-01-07 09:48:29 -08:00
two_level_iterator.cc Introduce ReadOptions::pin_data (support zero copy for keys) 2015-12-16 12:08:30 -08:00
two_level_iterator.h Seperate InternalIterator from Iterator 2015-10-13 15:32:13 -07:00