Skip to content

Conversation

@cijiugechu
Copy link
Contributor

What type of PR is this?

Prior art: serde_json switch to zmij.

Benchmarks:

Before:

cargo bench --bench serialize_value -- --quiet

twitter/sonic_rs::to_string
                        time:   [169.35 µs 171.97 µs 175.03 µs]
twitter/sonic_rs::to_string_use_rawnum
                        time:   [165.90 µs 166.70 µs 167.51 µs]
twitter/serde_json::to_string
                        time:   [264.41 µs 266.75 µs 270.01 µs]
twitter/simd_json::to_string
                        time:   [373.62 µs 375.00 µs 376.67 µs]

citm_catalog/sonic_rs::to_string
                        time:   [360.41 µs 361.24 µs 362.07 µs]
citm_catalog/sonic_rs::to_string_use_rawnum
                        time:   [335.28 µs 335.75 µs 336.34 µs]
citm_catalog/serde_json::to_string
                        time:   [354.97 µs 355.44 µs 355.93 µs]
citm_catalog/simd_json::to_string
                        time:   [595.46 µs 597.73 µs 600.29 µs]

canada/sonic_rs::to_string
                        time:   [2.3048 ms 2.3071 ms 2.3096 ms]
canada/sonic_rs::to_string_use_rawnum
                        time:   [900.75 µs 904.56 µs 908.61 µs]
canada/serde_json::to_string
                        time:   [2.3718 ms 2.3761 ms 2.3808 ms]
canada/simd_json::to_string
                        time:   [2.9103 ms 2.9259 ms 2.9432 ms]

After:

cargo bench --bench serialize_value -- --quiet

twitter/sonic_rs::to_string
                        time:   [157.88 µs 158.09 µs 158.29 µs]
twitter/sonic_rs::to_string_use_rawnum
                        time:   [154.21 µs 154.39 µs 154.58 µs]
twitter/serde_json::to_string
                        time:   [262.33 µs 262.63 µs 263.01 µs]
twitter/simd_json::to_string
                        time:   [366.31 µs 367.47 µs 368.78 µs]

citm_catalog/sonic_rs::to_string
                        time:   [348.75 µs 349.64 µs 350.52 µs]
citm_catalog/sonic_rs::to_string_use_rawnum
                        time:   [321.57 µs 322.08 µs 322.61 µs]
citm_catalog/serde_json::to_string
                        time:   [343.72 µs 344.04 µs 344.38 µs]
citm_catalog/simd_json::to_string
                        time:   [585.01 µs 587.35 µs 589.85 µs]

canada/sonic_rs::to_string
                        time:   [2.0157 ms 2.0189 ms 2.0223 ms]
canada/sonic_rs::to_string_use_rawnum
                        time:   [811.51 µs 818.01 µs 824.70 µs]
canada/serde_json::to_string
                        time:   [2.2198 ms 2.2226 ms 2.2255 ms]
canada/simd_json::to_string
                        time:   [2.9320 ms 2.9448 ms 2.9605 ms]

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
zh(optional):

(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

Copy link
Collaborator

@liuq19 liuq19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@liuq19 liuq19 merged commit ae08e4e into cloudwego:main Dec 26, 2025
12 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants