-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
OpenAPI/Swagger parsing is (?) performance bottleneck #3670
Comments
Thank you for filing the issue, will look into it |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
/remove-lifecycle stale |
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 |
/remove-lifecycle rotten |
Discussed offline, one option would be to try to switch to using kube-openapi, which stores the the openapi data in proto form. This could be worth looking into. |
/assign |
Only took a year, but I believe this is fixed now by #4568 :) |
I was wondering why running kustomize (& kpt) is not effectively instant, and I tracked down a large performance bottleneck - initializing the OpenAPI / parsing the swagger.
I believe this is the most significant constant-overhead for kustomize - obviously on very large kustomizations the data manipulation will eventually dominate.
I sent #3669 which adds a benchmark to quantify the impact; based on that it takes about 900ms to json parse the swagger itself; it takes about 20ms to un-gzip from the data embedded into the binary. These roughly tally with the performance overhead I see in the real world.
This particularly matters for e.g. kpt, where a kpt setter which uses kyaml also takes at least 1 second to run.
I think it would be interesting to cache the deserialized form.
But there's also some low-hanging fruit, e.g. the swagger UnmarshalJSON code calls
json.Unmarshal
twice over the same data (once for SwaggerProps, once for VendorExtensible). But that only gets us 2x, whereas caching (I'd SWAG) could be 100-1000x.The text was updated successfully, but these errors were encountered: