Conversation
Contributor
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
Copilot
AI
changed the title
[WIP] Replace the crate ryu_js to dragonbox.
API for ryu_js is https://docs.rs/ryu-js/latest/ryu_js
API for dragonbox is https://docs.rs/dragonbox/latest/dragonbox/
Replace ryu_js with dragonbox_ecma for floating point formatting
Aug 5, 2025
CodSpeed Instrumentation Performance ReportMerging #12821 will improve performances by 4.24%Comparing Summary
Benchmarks breakdown
|
Member
|
@copilot update |
Contributor
Author
5772043 to
dc92c41
Compare
Member
|
Ran test262 and monitor-oxc, all passed. |
dc92c41 to
a88a5d7
Compare
Replace ryu_js with dragonbox_ecma for floating point formatting Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com> [autofix.ci] apply automated fixes Update dragonbox_ecma from 0.0.3 to 0.0.5 Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
a88a5d7 to
cca1fd3
Compare
This was referenced Aug 6, 2025
taearls
pushed a commit
to taearls/oxc
that referenced
this pull request
Aug 12, 2025
…ting point formatting (oxc-project#12821) From the blog post https://v8.dev/blog/json-stringify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR replaces the
ryu_jscrate withdragonbox_ecmafor floating point to string conversion across the oxc codebase.Motivation
The migration moves from
ryu_jstodragonbox_ecmato modernize floating point formatting while maintaining ECMAScript specification compliance for JavaScript/TypeScript tooling.Changes
Dependencies
ryu-js = "1.0.2"todragonbox_ecma = "0.0.3"Implementation
ryu_js::Bufferwithdragonbox_ecma::Bufferfor f64 formatting. Sincedragonbox_ecmaonly supports f64, implemented custom f32 formatting for edge cases (MIN/MAX values) to maintain exact compatibility with existing tests.ToJsStringtrait implementation to usedragonbox_ecma::Bufferprint_non_negative_floatandget_minified_numberfunctions to usedragonbox_ecma::BufferTechnical Details
dragonbox_ecmawas chosen over regulardragonboxbecause it provides ECMAScript-compliant formatting, which is essential for JavaScript/TypeScript tooling. The key challenge was thatdragonbox_ecmaonly supports f64, whileryu_jssupported both f32 and f64. The solution:dragonbox_ecmafor all f64 formattingryu_js)ryu_jsTesting
ryu_jsThe migration maintains exact output compatibility while modernizing the floating point formatting dependency.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.