Remove unnecessary branch in Range::find_first_of(Range,size_t)
Summary:
Added benchmarks.
Before:
folly/test/RangeFindBenchmark.cpp relative time/iter iters/s
============================================================================
string length 10:
FindFirstOfRange 1.36ns 733.07M
FindFirstOfOffsetRange 2.15ns 464.16M
============================================================================
string length 256:
FindFirstOfRange 1.36ns 733.07M
FindFirstOfOffsetRange 1.42ns 704.22M
============================================================================
string length 10240:
FindFirstOfRange 1.36ns 733.07M
FindFirstOfOffsetRange 3.72ns 268.70M
============================================================================
string length
10485760:
FindFirstOfRange 1.36ns 733.07M
FindFirstOfOffsetRange 5.00ns 199.96M
After:
string length 10:
FindFirstOfRange 1.36ns 732.92M
FindFirstOfOffsetRange 1.36ns 732.61M
============================================================================
string length 256:
FindFirstOfRange 1.36ns 732.93M
FindFirstOfOffsetRange 1.38ns 727.16M
============================================================================
string length 10240:
FindFirstOfRange 1.36ns 732.93M
FindFirstOfOffsetRange 1.79ns 558.40M
============================================================================
string length
10485760:
FindFirstOfRange 1.36ns 732.93M
FindFirstOfOffsetRange 2.73ns 366.44M
Test Plan: fbconfig folly && fbmake runtests
Reviewed By: delong.j@fb.com
FB internal diff:
D660125