Skip to content

Commit 6d52bd4

Browse files
committed
add schubfach algorithm to the benchmark
1 parent 29a5135 commit 6d52bd4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

benchmarks/benchmark.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "double-conversion/double-conversion.h"
2020
#include "grisu_exact.h"
2121
#include "dragon4.h"
22+
#include "schubfach_64.h"
2223

2324
#define IEEE_8087
2425
#include "benchutil.h"
@@ -153,6 +154,16 @@ void process(std::vector<double> &lines) {
153154
std::cout << "# std::to_chars not supported" << std::endl;
154155
#endif
155156

157+
pretty_print(lines, "schubfach", [](const std::vector<double> &lines) {
158+
double volume = 0;
159+
char buffer[100];
160+
for (const auto d : lines) {
161+
const char *end_ptr = schubfach::Dtoa(buffer, d);
162+
volume += end_ptr - &buffer[0];
163+
}
164+
return volume;
165+
});
166+
156167
pretty_print(lines, "dragonbox", [](const std::vector<double> &lines) {
157168
double volume = 0;
158169
char buffer[100];

0 commit comments

Comments
 (0)