-
Notifications
You must be signed in to change notification settings - Fork 62
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
reconsider use of json-iterator / reflect2 #202
Comments
I think the uses here are benchmarked and it should be easy to tell if swapping out json-iterator causes a regression. |
kubernetes/kubernetes#105030 is now merged and this is on the short-list of things in k/k that still use json-iterator |
it looks like this uses really specialized serializing capabilities provided by json-iterator... not sure swapping will be easy |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/reopen |
@liggitt: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
with the release of go1.18, the json-iterator / reflect2 versions this lib uses as of today will not work with current versions of go |
When json-next-experimental becomes non-experimental, we could consider this. I don't think we need to solve this right now though. |
I would still consider use of json-iterator a risk due to its history with correctness issues and reliance on specific internal implementations of the go runtime |
There is more trouble that reflect2 brings. It inhibits the dead code elimination in the golang compiler. Golang 1.22 has learned to keep the DCE enabled when the usages of
|
The approach taken by json-iterator and its reflect library is not long-term stable (it pins to internal details of the stdlib reflect package), and requires maintenance per go release, which does not appear to be sustainable golang/go#48238 (comment)
Minimum versions to work with go1.18+ are:
In addition to the maintenance aspect, it is hard to reason about the safety of the implementation (golang/go#48238 (comment))
I'm exploring what it would look like to use the stdlib json decoder as a base and add in the features we rely on (case-sensitive keys, preservation of ints/floats, etc) in kubernetes/kubernetes#105030
I would encourage this project to consider the long-term sustainability/safety of the json-iterator dependency as well.
The text was updated successfully, but these errors were encountered: