-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Improve string encoding by following json approach #1350
Merged
Merged
+190
−63
Commits on Sep 8, 2023
-
Improve string encoding by following json approach
Benchmark results goos: linux goarch: amd64 pkg: go.uber.org/zap/zapcore cpu: AMD EPYC 7B13 │ /tmp/old.txt │ /tmp/new.txt │ │ sec/op │ sec/op vs base │ ZapJSON-8 89.10µ ± 1% 33.38µ ± 3% -62.54% (p=0.000 n=10) StandardJSON-8 40.74µ ± 1% 42.46µ ± 1% +4.22% (p=0.000 n=10) geomean 60.25µ 37.65µ -37.52%
Configuration menu - View commit details
-
Copy full SHA for 414a7b5 - Browse repository at this point
Copy the full SHA 414a7b5View commit details
Commits on Sep 9, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 044300b - Browse repository at this point
Copy the full SHA 044300bView commit details -
Configuration menu - View commit details
-
Copy full SHA for e12743b - Browse repository at this point
Copy the full SHA e12743bView commit details -
This no longer needs to be a separate function.
Configuration menu - View commit details
-
Copy full SHA for 85815f6 - Browse repository at this point
Copy the full SHA 85815f6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9165693 - Browse repository at this point
Copy the full SHA 9165693View commit details -
test: Add fuzz test for safeAppendStringLike
Adds a fuzz test for the string and []byte versions of safeAppendStringLike that verifies that both variants are able to decode the original string back.
Configuration menu - View commit details
-
Copy full SHA for f974d60 - Browse repository at this point
Copy the full SHA f974d60View commit details -
perf: Apply the same optimization to multi-byte runes
The optimization is basically "instead of appending byte at a time, skip over non-special bytes and append them all together." The original optimization applies only to single-byte runes. This applies the same to multi-byte runes.
Configuration menu - View commit details
-
Copy full SHA for c00d33c - Browse repository at this point
Copy the full SHA c00d33cView commit details -
Flips the logic a little to be easier to follow. The shape is basically: if mutli byte rune { if no special handling { skip continue } special handling } else { if no special handling { skip continue } special handling } This makes the logic much more obvious while retaining performance.
Configuration menu - View commit details
-
Copy full SHA for dc239f1 - Browse repository at this point
Copy the full SHA dc239f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for ced79e2 - Browse repository at this point
Copy the full SHA ced79e2View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.