Skip to content
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

StringToDouble: 2.64x speed-up possible via Eisel algorithm #137

Closed
nigeltao opened this issue Jul 15, 2020 · 1 comment
Closed

StringToDouble: 2.64x speed-up possible via Eisel algorithm #137

nigeltao opened this issue Jul 15, 2020 · 1 comment

Comments

@nigeltao
Copy link

https://lemire.me/blog/2020/03/10/fast-float-parsing-in-practice/ briefly describes a new StringToDouble algorithm by Michael Eisel. It claims a 2.64x speed-up versus this library, github.com/google/double-conversion.

The github.com/google/wuffs repo contains a re-implementation of that Eisel algorithm:

https://crrev.com/c/2291558/11 is an experimental change to the Chromium web browser to use Wuffs' Eisel implementation instead of google/double-conversion. Parsing various JSON files sped up by between 1.01x and 1.46x. That's the total time to parse a JSON file (and allocate the resultant node tree), not just the net time spent in StringToDouble or its equivalent. Obviously, the speed-up is more dramatic for number-ful JSON (as opposed to string-ful JSON).

Perhaps this library should consider adopting the same algorithm.

@floitsch
Copy link
Collaborator

The string->double conversion was never optimized in this library. It should have a decent speed, but there are definitely low hanging fruits.
Unfortunately, I currently don't have time to improve the library (as long as it yields the correct results).
For example, the library could/should also switch to Ryu (https://github.com/ulfjack/ryu) which should make it faster and avoid the pesky corner cases described in #83.

Closing, to avoid giving the impression that someone is working on it.
If I find the time to work on it, I will reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants