Short-circuit operator== based on size()
Summary: We don't do this today, but it looks like std::string does. For longer, similar strings, this is a big win. Before: ```lang=text ============================================================================ ./folly/test/FBStringTestBenchmarks.cpp.h relative time/iter iters/s ============================================================================ BM_equality_string(65536) 5.13ms 194.87 BM_equality_fbstring(65536) 11.34ms 88.18 ============================================================================ ``` After: ```lang=text ============================================================================ ./folly/test/FBStringTestBenchmarks.cpp.h relative time/iter iters/s ============================================================================ BM_equality_string(65536) 5.01ms 199.74 BM_equality_fbstring(65536) 6.63ms 150.78 ============================================================================ ``` Test Plan: Benchmark, unit tests Reviewed By: tudorb@fb.com FB internal diff: D737482
Showing
Please register or sign in to comment