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

JSON read/write benchmarks #1490

Merged
merged 1 commit into from
Feb 5, 2025
Merged

JSON read/write benchmarks #1490

merged 1 commit into from
Feb 5, 2025

Conversation

SpencerTorres
Copy link
Member

Summary

Closes #1474, see that thread for a breakdown of the results.

Output

goos: linux
goarch: amd64
pkg: github.com/ClickHouse/clickhouse-go/v2/benchmark
cpu: AMD Ryzen 9 7950X 16-Core Processor            
BenchmarkJSONInsert
BenchmarkJSONInsert/paths
BenchmarkJSONInsert/paths-32         	 5987515	       982.7 ns/op	    2408 B/op	      11 allocs/op
BenchmarkJSONInsert/structs
BenchmarkJSONInsert/structs-32       	 1620612	      3741 ns/op	    5437 B/op	      55 allocs/op
BenchmarkJSONInsert/marshal_strings
BenchmarkJSONInsert/marshal_strings-32         	 2864232	      2074 ns/op	    3473 B/op	      28 allocs/op
BenchmarkJSONInsert/strings
BenchmarkJSONInsert/strings-32                 	33972870	       150.6 ns/op	    2098 B/op	       2 allocs/op
BenchmarkJSONRead
BenchmarkJSONRead/paths
BenchmarkJSONRead/paths-32                     	 1385293	      4327 ns/op	    5411 B/op	     113 allocs/op
BenchmarkJSONRead/structs
BenchmarkJSONRead/structs-32                   	  971325	      6202 ns/op	    4697 B/op	     165 allocs/op
BenchmarkJSONRead/marshal_strings
    json_test.go:327: cannot receive JSON strings
--- SKIP: BenchmarkJSONRead/marshal_strings
BenchmarkJSONRead/strings
    json_test.go:331: cannot receive JSON strings
--- SKIP: BenchmarkJSONRead/strings
BenchmarkJSONMarshal
BenchmarkJSONMarshal/paths_direct
BenchmarkJSONMarshal/paths_direct-32           	  826999	      7351 ns/op	    4949 B/op	      86 allocs/op
BenchmarkJSONMarshal/paths
BenchmarkJSONMarshal/paths-32                  	  705961	      8643 ns/op	    5333 B/op	      87 allocs/op
BenchmarkJSONMarshal/structs
BenchmarkJSONMarshal/structs-32                	 2479334	      2389 ns/op	    1340 B/op	      26 allocs/op

@SpencerTorres SpencerTorres merged commit 9740798 into main Feb 5, 2025
12 checks passed
@SpencerTorres SpencerTorres deleted the json_bench branch February 5, 2025 23:27
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.

Performance Benchmarking for JSON type serialization, Object vs String
1 participant