Skip to content

Add benchmark for large payloads with string escaping #536

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

peterebden
Copy link

Illustrates the issue in #535

Output on my machine:

goos: linux
goarch: amd64
cpu: AMD Ryzen 9 5900X 12-Core Processor            
Benchmark_EscapedStrings_GoJson-24          	      1	27586403115 ns/op	23464256 B/op	 100081 allocs/op
Benchmark_EscapedStrings_EncodingJson-24    	     13	 82155502 ns/op	47859819 B/op	 300046 allocs/op
PASS
ok  	command-line-arguments	28.829s

Note that the two are pretty competitive if the payload size is reduced to 1000 objects. At 1000000 (10x this PR) it may as well be hanging.

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.

1 participant