Commit be7be7e2 authored by Jeremy Lilley's avatar Jeremy Lilley Committed by Tudor Bosman

Add "short append" benchmark to fbstring benchmark suite.

Summary:
Appending many small strings to fbstring appears much slower (~3x) vs.
std::string. Adding benchmark case to illustrate.

[If this isn't wanted, I can revert]

Test Plan: This is a benchmark.

Reviewed By: soren@fb.com

FB internal diff: D544159
parent 5d3f05bd
......@@ -222,3 +222,14 @@ BENCHMARK_PARAM(BENCHFUN(push_back), 1);
BENCHMARK_PARAM(BENCHFUN(push_back), 23);
BENCHMARK_PARAM(BENCHFUN(push_back), 127);
BENCHMARK_PARAM(BENCHFUN(push_back), 1024);
void BENCHFUN(short_append)(int iters, int arg) {
FOR_EACH_RANGE (i, 0, iters) {
STRING s;
FOR_EACH_RANGE (j, 0, arg) {
s += "012";
}
}
}
BENCHMARK_PARAM(BENCHFUN(short_append), 23);
BENCHMARK_PARAM(BENCHFUN(short_append), 1024);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment