Add more benchmarks for integer-to-string conversion
authorMarcus Holland-Moritz <mhx@fb.com>
Fri, 24 Jun 2016 02:04:09 +0000 (19:04 -0700)
committerFacebook Github Bot 7 <facebook-github-bot-7-bot@fb.com>
Fri, 24 Jun 2016 02:08:40 +0000 (19:08 -0700)
commit05a4c2214c0fe151e03e642e3892844f57fa3922
treee83cec5b5d1ebb3006b34b71036ef8038780ad95
parent29c7ba51cdf0db9c5809a43ff6eab7e14bf21b6f
Add more benchmarks for integer-to-string conversion

Summary:
In preparation for some changes to the integer-to-string conversion
code, this change adds, this adds some more benchmarks, and attempts
to update the existing ones to be less prone to the optimizations
where the compiler already knows about the constant values being
passed in.

There also were a couple of flaws in the existing benchmarks, where
instead of computing the value to be converted from a start value
and the loop counter, it rather added the (constant) total iteration
count to the value, ending up with a constant. But, worse than just
using a constant, the code that was trying to evaluate the cost of
converting a single-digit would generally end up computing the cost
of a five-digit number, which resulted in the benchmarks showing
identical figures regardless of the number of digits for small digit
counts.

The change also adds benchmarks for positive/negative signed integers
and 128-bit integers.

Reviewed By: yfeldblum

Differential Revision: D3455815

fbshipit-source-id: a20821c7d460bc05453655d0c848a0c9a47520fd
folly/test/ConvBenchmark.cpp