Closed sirinath closed 3 years ago
These three implementations are basically the same.
Alexander's decimal-to-binary conversion routine is a little bit different at some points but I believe it should not be a big deal.
On the other hand, his string generation routine is somewhat different from what's used here.
I think his implementation is probably faster, but it's at the same time a little bit of cheating because it writes more digits to the buffer than needed. For example, it might write something like "1.00000000"
and then overwrite it with "1e0\0"
.
(There are just too many possible tweaks and different constraints we can think of for the string generation. This overwrite behavior might be acceptable for some situations, might not for some other situations. This is why I emphasize the conversion and does not try to pay too much attention to the string generation.)
Also, this repo is the reference implementation of the Dragonbox algorithm. Therefore, it is less meaningful to compare the performance of this implementation with other implementations of the same algorithm than to compare it with other algorithms.
Thus, I have no plan to include these implementations in the benchmark.
But I will update the benchmark in a near future because other libraries have been improved recently (mainly fmt
, which improved its internal integration with Dragonbox a lot compared to the version I benchmarked).
because other libraries have been improved recently
Since the state of the art has improve can this also be optimised further to be more faster.
So that performance comparison can be done between different implementation add them to the benchmarks: