-
Notifications
You must be signed in to change notification settings - Fork 2
refactor: borrow the sonic-rs string escape implementation #27
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
Conversation
CodSpeed Performance ReportMerging #27 will improve performances by 25.75%Comparing Summary
Benchmarks breakdown
Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the library to borrow the sonic-rs string escape implementation instead of using the original custom SIMD implementations. The change aims to improve performance, particularly for small inputs, while avoiding the overhead of using sonic-rs directly as a dependency.
- Replaced custom x86 and aarch64 SIMD implementations with sonic-rs borrowed code
- Removed platform-specific modules and feature flags
- Updated benchmarks to include sonic-rs comparisons and short string tests
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/lib.rs | Complete rewrite using sonic-simd crate with borrowed string escaping logic |
src/x86.rs | Removed entire x86-specific SIMD implementation |
src/aarch64.rs | Removed entire aarch64 NEON implementation |
examples/escape.rs | Updated to compare against sonic-rs and serde_json |
benches/escape.rs | Added sonic-rs benchmark and short string tests |
benches/generic.rs | Removed unused escape_into_generic function |
Cargo.toml | Added sonic-simd, sonic-rs dependencies and updated criterion |
README.md | Updated documentation to reflect sonic-rs implementation |
.github/workflows/CI.yml | Added miri testing workflow |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@codex review |
cursor review |
Skipping Bugbot: Bugbot is disabled for this repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
https://github.com/cloudwego/sonic-rs is faster than our previous implementation, but we don't want to use it directly.
For small inputs:
vs