10000 Use json-iterator/go for all JSON operations by apocelipes · Pull Request #556 · boyter/scc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use json-iterator/go for all JSON operations #556

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

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

apocelipes
Copy link
Contributor

Currently, we have two JSON libraries in the code base: "encoding/json" and "github.com/json-iterator/go". Use one of them is completely enough.

The "json-iterator/go" is faster than the stdlib and uses less memory. So we choose the fast one for all JSON operations.

It also reduces the binary file size. For an example on Linux AMD64 with Go1.22.7, the binary file change is 8988568 -> 8811060 bytes, more than 150 kib was reduced.

@boytertesting boytertesting bot added M/complexity Normal or medium complexity XL/size Extra large change labels Nov 6, 2024
@apocelipes apocelipes changed the title Using jsoniter for all JSON operations Use json-iterator/go for all JSON operations Nov 11, 2024
@boytertesting boytertesting bot added M/complexity Normal or medium complexity M/size Normal or medium sized change and removed M/complexity Normal or medium complexity XL/size Extra large change labels Nov 11, 2024
@boyter
Copy link
Owner
boyter commented Nov 11, 2024

Reduction of the binary size is the main reason I like this. The reason I removed it was due to the speed being negligible for everything I tried.

@boyter boyter merged commit 0ff481e into boyter:master Nov 11, 2024
5 checks passed
@apocelipes apocelipes deleted the using-jsoniter branch November 12, 2024 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M/complexity Normal or medium complexity M/size Normal or medium sized change
Projects
Status: DONE
Development

Successfully merging this pull request may close these issues.

2 participants
0