Performance Improvement for AsciiCaseInsensitive
authorNima Aghdaii <naghdaii@fb.com>
Tue, 11 Mar 2014 00:58:29 +0000 (17:58 -0700)
committerDave Watson <davejwatson@fb.com>
Mon, 31 Mar 2014 17:44:19 +0000 (10:44 -0700)
commit10a3632117951cb83334903385d13a176e8ce14e
tree343751da647d637ebf1c08abb64df5029e80943f
parent11aac0ecf6851429e9815f09bde7cd1ec11c0bf8
Performance Improvement for AsciiCaseInsensitive

Summary:
This implementation improves the performance of AsciiCaseInsensitive.
AsciiCaseInsensitive uses toupper, and it's slow.
Since toupper only works for ascii characters and this function does exactly the same thing over the range of [0..256), we can gain 3x performance here.

Test Plan: unit test and benchmark

Reviewed By: lucian@fb.com

FB internal diff: D1217596

@override-unit-failures
folly/Range.h
folly/test/AsciiCaseInsensitiveBenchmark.cpp [new file with mode: 0644]
folly/test/AsciiCaseInsensitiveTest.cpp [new file with mode: 0644]