15 #include "absl/strings/charconv.h"
21 #include "benchmark/benchmark.h"
26 const char* pi =
"3.14159";
27 for (
auto s :
state) {
35 const char* pi =
"3.14159";
36 const char* pi_end = pi + strlen(pi);
37 for (
auto s :
state) {
47 const char* pi =
"3.14159";
48 for (
auto s :
state) {
56 const char* pi =
"3.14159";
57 const char* pi_end = pi + strlen(pi);
58 for (
auto s :
state) {
68 const char*
num =
"272104041512242479.e200";
69 for (
auto s :
state) {
77 const char* numstr =
"272104041512242479.e200";
78 const char* numstr_end = numstr + strlen(numstr);
79 for (
auto s :
state) {
89 const char*
num =
"94080055902682397.e-242";
90 for (
auto s :
state) {
98 const char* numstr =
"94080055902682397.e-242";
99 const char* numstr_end = numstr + strlen(numstr);
100 for (
auto s :
state) {
111 const char*
num = huge.c_str();
112 for (
auto s :
state) {
121 const char*
num = huge.c_str();
122 const char* num_end =
num + 200;
123 for (
auto s :
state) {
138 "152113937042223790993097181572444900347587985074226836242307364987727724"
139 "831384300183638649152607195040591791364113930628852279348613864894524591"
140 "272746490313676832900762939595690019745859128071117417798540258114233761"
141 "012939937017879509401007964861774960297319002612457273148497158989073482"
142 "171377406078223015359818300988676687994537274548940612510414856761641652"
143 "513434981938564294004070500716200446656421722229202383105446378511678258"
144 "370570631774499359748259931676320916632111681001853983492795053244971606"
145 "922718923011680846577744433974087653954904214152517799883551075537146316"
146 "168973685866425605046988661997658648354773076621610279716804960009043764"
147 "038392994055171112475093876476783502487512538082706095923790634572014823"
148 "78877699375152587890625" +
152 return digits.substr(0,
length) +
"1e-297";
157 const char*
begin = testcase.c_str();
158 for (
auto s :
state) {
163 BENCHMARK(BM_Strtod_Big_And_Difficult)->Range(3, 5000);
167 const char*
begin = testcase.c_str();
168 const char*
end =
begin + testcase.size();
169 for (
auto s :
state) {
176 BENCHMARK(BM_Absl_Big_And_Difficult)->Range(3, 5000);