-
Notifications
You must be signed in to change notification settings - Fork 843
Fix isNullish to properly handle typed nil #107
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
benchmark old ns/op new ns/op delta BenchmarkParser-4 6310982 1455274 -76.94% benchmark old allocs new allocs delta BenchmarkParser-4 1340 412 -69.25% benchmark old bytes new bytes delta BenchmarkParser-4 2848964 16522 -99.42%
benchmark old ns/op new ns/op delta BenchmarkParser-4 1455274 47895 -96.71% benchmark old allocs new allocs delta BenchmarkParser-4 412 424 +2.91% benchmark old bytes new bytes delta BenchmarkParser-4 16522 16952 +2.60%
benchmark old ns/op new ns/op delta BenchmarkDefaultResolveFn-4 4727 172 -96.36% benchmark old allocs new allocs delta BenchmarkDefaultResolveFn-4 19 1 -94.74% benchmark old bytes new bytes delta BenchmarkDefaultResolveFn-4 2021 16 -99.21%
benchmark old ns/op new ns/op delta BenchmarkPrint-4 5676362 32231 -99.43% benchmark old allocs new allocs delta BenchmarkPrint-4 25868 210 -99.19% benchmark old bytes new bytes delta BenchmarkPrint-4 1146858 11744 -98.98%
benchmark old ns/op new ns/op delta BenchmarkValidateDocument-4 3689089 1757236 -52.37% benchmark old allocs new allocs delta BenchmarkValidateDocument-4 14282 5721 -59.94% benchmark old bytes new bytes delta BenchmarkValidateDocument-4 536062 257161 -52.03%
benchmark old ns/op new ns/op delta BenchmarkValidateDocument-4 1757236 1727862 -1.67% benchmark old allocs new allocs delta BenchmarkValidateDocument-4 5721 5639 -1.43% benchmark old bytes new bytes delta BenchmarkValidateDocument-4 257161 247368 -3.81%
benchmark old ns/op new ns/op delta BenchmarkValidateDocument-4 1727862 505599 -70.74% benchmark old allocs new allocs delta BenchmarkValidateDocument-4 5639 1450 -74.29% benchmark old bytes new bytes delta BenchmarkValidateDocument-4 247368 110322 -55.40%
benchmark old ns/op new ns/op delta BenchmarkValidateDocument-4 515388 160199 -68.92% benchmark old allocs new allocs delta BenchmarkValidateDocument-4 1450 645 -55.52% benchmark old bytes new bytes delta BenchmarkValidateDocument-4 110322 101546 -7.95%
benchmark old ns/op new ns/op delta BenchmarkValidateDocument-4 160199 102851 -35.80% benchmark old allocs new allocs delta BenchmarkValidateDocument-4 645 139 -78.45% benchmark old bytes new bytes delta BenchmarkValidateDocument-4 101546 26920 -73.49%
Sorry for the noise, forgot this PR was open and when I merged to our fork's master it updated it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The test demonstrates what the problem was. For typed nil values (e.g. fields of a struct that are pointers to other structs), isNullish wasn't properly detecting the nil value.
Also removed the NaN check for int since there's no case where it can be true as far as I know.