Nathan Bronson 1ae27113c7 reduce comparisons by skiplist
Summary:
Key comparison is the single largest CPU user for CPU-bound
workloads. This diff reduces the number of comparisons in two ways.

The first is that it moves predecessor array gathering from
FindGreaterOrEqual to FindLessThan, so that FindGreaterOrEqual can
return immediately if compare_ returns 0.  As part of this change I
moved the sequential insertion optimization into Insert, to remove the
undocumented (and smelly) requirement that prev must be equal to prev_
if it is non-null.

The second optimization is that all of the search functions skip calling
compare_ when moving to a lower level that has the same Next pointer.
With a branching factor of 4 we would expect this to happen 1/4 of
the time.

On a single-threaded CPU-bound workload (-benchmarks=fillrandom -threads=1
-batch_size=1 -memtablerep=skip_list -value_size=0 --num=1600000
-level0_slowdown_writes_trigger=9999 -level0_stop_writes_trigger=9999
-disable_auto_compactions --max_write_buffer_number=8
-max_background_flushes=8 --disable_wal --write_buffer_size=160000000)
on my dev server this is good for a 7% perf win.

Test Plan: unit tests

Reviewers: rven, ljin, yhchiang, sdong, igor

Reviewed By: igor

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D43233
2015-08-11 11:25:22 -07:00
..
2015-07-17 18:59:11 +02:00
2015-07-17 12:02:52 -07:00
2015-08-05 07:33:27 -07:00
2015-07-20 17:20:40 -07:00
2015-08-10 11:30:36 -07:00
2015-08-07 21:59:51 -07:00
2015-08-06 17:59:05 -07:00
2015-08-06 17:59:05 -07:00
2015-07-20 17:20:40 -07:00
2015-04-23 12:10:36 -07:00
2015-03-17 14:08:00 -07:00
2015-08-07 21:59:51 -07:00
2015-08-06 17:59:05 -07:00
2015-01-26 11:48:07 -08:00
2015-07-07 12:10:10 -07:00
2015-07-07 12:10:10 -07:00
2015-08-05 07:33:27 -07:00
2015-08-05 07:33:27 -07:00
2015-03-30 16:05:35 -04:00
2015-03-17 14:08:00 -07:00
2015-08-11 11:25:22 -07:00
2015-08-06 17:59:05 -07:00
2015-02-06 08:44:30 -08:00
2015-08-07 21:59:51 -07:00
2015-07-20 17:20:40 -07:00
2014-11-10 17:39:38 -05:00
2015-07-29 16:54:23 -07:00
2015-07-29 16:54:23 -07:00
2015-08-06 17:59:05 -07:00
2015-05-29 14:36:35 -07:00