Use aligned loads for Range::find_first_of
authorMike Curtiss <mcurtiss@fb.com>
Fri, 22 Feb 2013 22:28:05 +0000 (14:28 -0800)
committerJordan DeLong <jdelong@fb.com>
Tue, 19 Mar 2013 00:09:28 +0000 (17:09 -0700)
commit81af5c4c569265ae4e503e96429d93f3d8f47e65
treea1f1d5770a1f393ba230c67edc8268223f30f777
parentdf1ffef33a788d14089e7fad2ee6cb84d192504b
Use aligned loads for Range::find_first_of

Summary:
Aligned loads are faster on some architectures. Let's refactor
qfind_first_of so that it uses aligned loads when possible.

Also modify the benchmarks to account for begin/end-of-string
logic.

Test Plan:
Tests pass. Updated benchmarks.  Generally seeing a 5-20%
speed-up, depending on the situation.

Reviewed By: philipp@fb.com

FB internal diff: D720369
folly/Range.cpp
folly/test/RangeFindBenchmark.cpp