-
Notifications
You must be signed in to change notification settings - Fork 65
Migrate to encoding/json/v2 #292
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
base: master
Are you sure you want to change the base?
Conversation
For the
|
a4b6871
to
bdce391
Compare
I fixed the test failure. |
/assign @BenTheElder @liggitt |
/assign @jpbetz |
I suspect using a json marshal function (like MarshalWrite) that doesn't append a newline would be a more efficient way to accomplish that |
fieldpath/serialize-pe.go
Outdated
return nil, fmt.Errorf("parsing JSON: %v", err) | ||
} | ||
|
||
k := rawKey.String() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is rawKey.String() the same as decoding to a string, in terms of interpreting escape sequences, etc?
{ | ||
JSON: `1.0`, | ||
IntoType: reflect.TypeOf(json.Number("")), | ||
Want: json.Number("1.0"), | ||
}, | ||
{ | ||
JSON: `1`, | ||
IntoType: reflect.TypeOf(json.Number("")), | ||
Want: json.Number("1"), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious if it's ok to drop these... were they added to try to catch a specific issue?
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: inteon The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The The serialize benchmarks still look pretty rough. Need to see what we can improve there. |
did you run the full set of benchmarks to see how we looked across all of them? |
Signed-off-by: Tim Ramlot <[email protected]>
Signed-off-by: Tim Ramlot <[email protected]>
Signed-off-by: Tim Ramlot <[email protected]>
Signed-off-by: Tim Ramlot <[email protected]>
Thanks for the updates, how are the overall benchmarks looking (not just the subset in the description)? As you were adjusting the implementation, were there any unit tests it would make sense to add to catch edges the previous implementations handled we want to ensure the new one does as well? I'm thinking specifically of things like:
|
First off- it's amazing to see this happening and the benchmarks are VERY promising. Thanks @inteon! To get this to the finish line, and merge, what should our criteria be? I chatted offline with @liggitt briefly and some of the criteria we discussed was:
Intuitively, it seems like the deserialization is already sufficiently fast. I suspect we need to optimize serialization a bit further since we serialize managed fields on all updates (not just patches). That said, I'm willing to be data driven here. If we can show downstream scale and performance is acceptable, I'm willing to accept a higher serialization perf regression in order to migrate to json/v2. Thoughts, concerns? |
Replaces the
github.com/json-iterator/go
dependency withencoding/json/v2
.Performance is not yet great (feel free to push improvements/ create new PRs based on this PR):
closes #202