-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement: Compare with more algorithms in benchmark #28
Comments
We'd first have to support fixed-precision output, which the code does not right now (although it shouldn't be hard to add, see also #27). Generally speaking, this is not a benchmark repository. Maybe it would be better to add a benchmark for Ryu over there, rather than adding a lot of benchmarks here. |
i asked milo about adding your function to his benchmark suite - maybe you can add a reference to his tests (when integrated) |
I benchmarked my Perhaps this issue should be resolved, since this is indeed not a benchmark repository and it doesn't seem that doing anything else here would be a valuable use of time? While it appears that double-conversion is not the fastest possible Grisu implementation, it has the advantage of matching Ryu's correctly rounded output, and Ryu indeed appears to be the fastest in the world by a wide margin, so the choice of comparison algorithm seems unimportant (except for "promotional" purposes). In my optimization efforts, I've focused on improving Ryu's absolute performance; the relative performance (especially against |
I think here should be sets of parameterized benchmarks , at least to track progress through changes and drive experiments. Jsoniter-scala (one of first adopters of Ryu) has a growing set of benchmarks from the beginning. It helped a lot to drive improvements using different profilers and to spot regressions on new JVMs. Here are results from the latest run: https://plokhotnyuk.github.io/jsoniter-scala/ E. g. a lot of mitigations where done to avoid 3x times slowdown regression with Graal due missing compiler optimization for division by constant: |
Take look to my dtoa-benchmark fork.
C/C++ results sorted by RMS:
|
@leo-yuriev could you, please, update your charts for different number of digits to see results of ryu and erthink in them? |
@plokhotnyuk, today I spent some time to Refine the benchmark to make it easier and more convenient to get a results (I pushed those changes for now). RandomDigit: Generates 1000 random double values, filtered out +/-inf and nan. Then convert them to limited precision (1 to 17 decimal digits in significand). Finally convert these numbers into ASCII.
The "sequental" testcase: Actually it converts 10000 numbers with random mantissa for each decimal exponent in range 0...16. So, I think we can treats it as a random numbers with some known distribution/bias of an exponent.
So, my preliminary findings are:
P.S. The "RMS" in tables actually is a sqrt(sum of squares), i.e. has not normalized for number of values.. |
see Milo Yips / C++ double-to-string conversion benchmark
https://github.com/miloyip/dtoa-benchmark
The text was updated successfully, but these errors were encountered: