For a while now, we have been using V8's double_conversion library for double/float parsing, but we should consider replacing it with Daniel Lemire's fast_float, https://github.com/fastfloat/fast_float, which reports even better performance.
Sounds interesting! We know that double->string conversion is actually super important (frequently done for debugging, JSON, etc.). So if this is faster, it is definitely worth doing :)
https://github.com/apache/arrow/pull/8494 Apache Arrow replaced double_conversion from fast_float and observing performance improvement.
Note that, if it is faster, we could see improvement in Speedometer2/EmberJS-Debug
Ah, no. EmberDebug is for double->string. This library is string->double. So some of JSON benchmark can get benefit.
(In reply to Yusuke Suzuki from comment #4) > Ah, no. EmberDebug is for double->string. This library is string->double. So > some of JSON benchmark can get benefit. There are a few other things that might help that case. 1) We could try updating the version of double_conversion we have to the latest release. Not sure how long it's been since we last pulled in anything, so there might just be free wins there, 2) There are other libraries and papers that focus on the float -> string case: - https://github.com/abolz/Drachennest/ - the MSVC STL has a supposedly very fast version in std::to_chars (https://youtu.be/4P_kbF0EbZM is a fun talk if you are into that kind of thing) - https://news.ycombinator.com/item?id=24917659 has some additional discussion
https://github.com/apple/swift/pull/35299 might also be of interest for the opposite case.
Created attachment 419243 [details] experiment
<rdar://problem/73968546>
ToT Patched json-parse-financial 28.051+-0.094 ^ 27.630+-0.134 ^ definitely 1.0152x faster In Kraken's json-parse-financial, 1.5% faster (w/ 100 iteration).
Created attachment 419256 [details] Patch
We should kill int/nan etc. conversion feature.
One of the things I suggest we do is continue keep the interface to our string to floating point and floating point to string functions narrow so it’s straightforward for us to improve the implementation. I’ve tried to do this before, removing unnecessary entry points and variants and making the interface as clear as possible, while trying to stay careful to still allow us to have excellent performance. I am so excited to hear that fast_float looks so promising to improve performance!
(In reply to Yusuke Suzuki from comment #9) > ToT Patched > > json-parse-financial 28.051+-0.094 ^ 27.630+-0.134 > ^ definitely 1.0152x faster > > In Kraken's json-parse-financial, 1.5% faster (w/ 100 iteration). Nice!
Pull request: https://github.com/WebKit/WebKit/pull/2772
Committed 257675@main (178e0726ac6b): <https://commits.webkit.org/257675@main> Reviewed commits have been landed. Closing PR #2772 and removing active labels.
Does this impact float parsing in CSS and SVG?