mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
AK+LibJS: Replace home-grown Ryu implementation with fmt's dragonbox
In the benchmark added here, fmt's dragonbox is ~3x faster than our own Ryu implementation (1197ms for dragonbox vs. 3435ms for Ryu). Daniel Lemire recently published an article about these algorithms: https://lemire.me/blog/2026/02/01/converting-floats-to-strings-quickly/ In this article, fmt's dragonbox implementation is actually one of the slower ones (with the caveat that some comments note that the article is a bit out-of-date). I've gone with fmt here because: 1. It has a readily available recent version on vcpkg. 2. It provides the methods we need to actually convert a floating point to decimal exponential form. 3. There is an ongoing effort to replace dragonbox with a new algorithm, zmij, which promises to be faster. 4. It is one of the only users of AK/UFixedBigInt, so we can potentially remove that as well soon. 5. Bringing in fmt opens the door to replacing a bunch of AK::format facilities with fmt as well.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
721c05802c
commit
3355fb39ae
Notes:
github-actions[bot]
2026-02-23 17:31:53 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/3355fb39ae1 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8109 Reviewed-by: https://github.com/gmta ✅
@@ -55,6 +55,7 @@
|
||||
"zlib"
|
||||
]
|
||||
},
|
||||
"fmt",
|
||||
{
|
||||
"name": "fontconfig",
|
||||
"platform": "linux | bsd | osx"
|
||||
@@ -256,6 +257,10 @@
|
||||
"name": "ffmpeg",
|
||||
"version": "7.1.1#5"
|
||||
},
|
||||
{
|
||||
"name": "fmt",
|
||||
"version": "12.1.0#0"
|
||||
},
|
||||
{
|
||||
"name": "fontconfig",
|
||||
"version": "2.15.0#4"
|
||||
|
||||
Reference in New Issue
Block a user