Skip to content
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

chore: add benchmark with fastjson #760

Merged
merged 1 commit into from
Feb 28, 2025
Merged

chore: add benchmark with fastjson #760

merged 1 commit into from
Feb 28, 2025

Conversation

liuq19
Copy link
Collaborator

@liuq19 liuq19 commented Feb 27, 2025

What type of PR is this?

test

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):

benchmark command SONIC_NO_ASYNC_GC=1 GOMAXPROCS=8 go test -v -run=none -bench="BenchmarkParse.*Sonic.*|BenchmarkParse.*Fastjson.*|BenchmarkGet.*Sonic.*|BenchmarkGet.*Fastjson.*" ./external_jsonlib_test/benchmark_test

benchmark results

goos: linux
goarch: amd64
pkg: github.com/bytedance/sonic/external_jsonlib_test/benchmark_test
cpu: Intel(R) Xeon(R) Platinum 8336C CPU @ 2.30GHz
BenchmarkParseSeven_Sonic
BenchmarkParseSeven_Sonic-8                   111814          9079 ns/op    1435.78 MB/s
BenchmarkParseSeven_Parallel_Sonic
BenchmarkParseSeven_Parallel_Sonic-8          395978          3321 ns/op    3925.45 MB/s
BenchmarkParseOne_Fastjson
BenchmarkParseOne_Fastjson-8                   22285         57015 ns/op     228.62 MB/s
BenchmarkParseOne_Parallel_Fastjson
BenchmarkParseOne_Parallel_Fastjson-8          29853         35314 ns/op     369.12 MB/s
BenchmarkParseSeven_Fastjson
BenchmarkParseSeven_Fastjson-8                 25088         51720 ns/op     252.03 MB/s
BenchmarkParseSeven_Parallel_Fastjson
BenchmarkParseSeven_Parallel_Fastjson-8        35427         37848 ns/op     344.40 MB/s
BenchmarkGetOne_Sonic
BenchmarkGetOne_Sonic-8                       810714          1539 ns/op    8467.42 MB/s
BenchmarkGetOne_Parallel_Sonic
BenchmarkGetOne_Parallel_Sonic-8             5403757           199.3 ns/op  65404.74 MB/s
BenchmarkGetByKeys_Sonic
BenchmarkGetByKeys_Sonic-8                    920173          1322 ns/op    9860.04 MB/s
BenchmarkGetOne_Fastjson
BenchmarkGetOne_Fastjson-8                     24112         48641 ns/op     267.99 MB/s
BenchmarkGetOne_Parallel_Fastjson
BenchmarkGetOne_Parallel_Fastjson-8            33621         35112 ns/op     371.24 MB/s
PASS
ok      github.com/bytedance/sonic/external_jsonlib_test/benchmark_test 17.190s

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

Fixes #752

(optional) The PR that updates user documentation:

@liuq19 liuq19 merged commit f79eedd into main Feb 28, 2025
41 checks passed
@liuq19 liuq19 deleted the chore/bench branch February 28, 2025 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Benchmarks against other JSON libraries
2 participants