WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
221178
Investigate replacing double_conversion library with fast_float
https://bugs.webkit.org/show_bug.cgi?id=221178
Summary
Investigate replacing double_conversion library with fast_float
Sam Weinig
Reported
2021-01-30 08:41:15 PST
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.
Attachments
experiment
(98.02 KB, patch)
2021-02-03 23:22 PST
,
Yusuke Suzuki
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Patch
(106.24 KB, patch)
2021-02-03 23:59 PST
,
Yusuke Suzuki
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Yusuke Suzuki
Comment 1
2021-01-30 11:00:54 PST
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 :)
Yusuke Suzuki
Comment 2
2021-01-30 11:05:54 PST
https://github.com/apache/arrow/pull/8494
Apache Arrow replaced double_conversion from fast_float and observing performance improvement.
Yusuke Suzuki
Comment 3
2021-01-30 11:06:24 PST
Note that, if it is faster, we could see improvement in Speedometer2/EmberJS-Debug
Yusuke Suzuki
Comment 4
2021-01-30 11:11:38 PST
Ah, no. EmberDebug is for double->string. This library is string->double. So some of JSON benchmark can get benefit.
Sam Weinig
Comment 5
2021-01-30 12:41:12 PST
(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
Sam Weinig
Comment 6
2021-02-02 05:32:08 PST
https://github.com/apple/swift/pull/35299
might also be of interest for the opposite case.
Yusuke Suzuki
Comment 7
2021-02-03 23:22:20 PST
Created
attachment 419243
[details]
experiment
Radar WebKit Bug Importer
Comment 8
2021-02-03 23:46:00 PST
<
rdar://problem/73968546
>
Yusuke Suzuki
Comment 9
2021-02-03 23:57:27 PST
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).
Yusuke Suzuki
Comment 10
2021-02-03 23:59:03 PST
Created
attachment 419256
[details]
Patch
Yusuke Suzuki
Comment 11
2021-02-04 00:43:50 PST
We should kill int/nan etc. conversion feature.
Darin Adler
Comment 12
2021-02-04 10:00:36 PST
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!
Sam Weinig
Comment 13
2021-02-04 20:35:42 PST
(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!
Yusuke Suzuki
Comment 14
2022-07-26 23:45:01 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/2772
EWS
Comment 15
2022-12-09 22:56:34 PST
Committed
257675@main
(178e0726ac6b): <
https://commits.webkit.org/257675@main
> Reviewed commits have been landed. Closing PR #2772 and removing active labels.
Simon Fraser (smfr)
Comment 16
2022-12-10 16:11:11 PST
Does this impact float parsing in CSS and SVG?
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug