Islam AbdelRahman 4a21b1402c Cache heap::downheap() root comparison (optimize heap cmp call)
Summary:
Reduce number of comparisons in heap by caching which child node in the first level is smallest (left_child or right_child)
So next time we can compare directly against the smallest child

I see that the total number of calls to comparator drops significantly when using this optimization

Before caching (~2mil key comparison for iterating the DB)
```
$ DEBUG_LEVEL=0 make db_bench -j64 && ./db_bench --benchmarks="readseq" --db="/dev/shm/heap_opt" --use_existing_db --disable_auto_compactions --cache_size=1000000000  --perf_level=2
readseq      :       0.338 micros/op 2959201 ops/sec;  327.4 MB/s user_key_comparison_count = 2000008
```
After caching (~1mil key comparison for iterating the DB)
```
$ DEBUG_LEVEL=0 make db_bench -j64 && ./db_bench --benchmarks="readseq" --db="/dev/shm/heap_opt" --use_existing_db --disable_auto_compactions --cache_size=1000000000 --perf_level=2
readseq      :       0.309 micros/op 3236801 ops/sec;  358.1 MB/s user_key_comparison_count = 1000011
```

It also improves
Closes https://github.com/facebook/rocksdb/pull/1600

Differential Revision: D4256027

Pulled By: IslamAbdelRahman

fbshipit-source-id: 76fcc66
2016-12-01 13:39:14 -08:00
..
2016-08-19 12:28:19 -07:00
2016-11-21 12:24:13 -08:00
2016-08-31 08:56:34 -07:00
2016-08-19 12:28:19 -07:00
2016-11-14 22:54:17 -08:00
2016-09-13 12:08:22 -07:00
2016-05-06 17:42:50 -07:00
2016-11-21 12:24:13 -08:00
2016-12-01 10:09:22 -08:00
2016-03-11 22:56:25 -08:00
2016-03-15 11:38:15 -07:00
2016-11-09 15:09:18 -08:00
2016-11-28 16:39:14 -08:00
2016-11-23 09:24:15 -08:00
2016-02-17 20:22:40 +08:00
2016-10-29 16:09:18 -07:00
2016-09-01 13:50:39 -07:00
2016-09-01 13:50:39 -07:00
2016-06-10 16:37:36 -07:00
2016-04-01 11:06:06 -07:00
2016-09-02 17:10:28 -07:00