-
Notifications
You must be signed in to change notification settings - Fork 589
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
refactor: use gojson to marshal config for SHA #4222
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #4222 +/- ##
=======================================
- Coverage 62.6% 62.6% -0.1%
=======================================
Files 153 153
Lines 17006 17006
=======================================
- Hits 10656 10655 -1
+ Misses 5685 5683 -2
- Partials 665 668 +3
☔ View full report in Codecov by Sentry. |
Do you think it would be worth noting in the changelog? IMHO we could mention it in the "Under the hood" section, WDYT? It's a performance improvement and it might be worth making such changes visible to the users. |
I believe so, yes. Just wanted to gather feedback from the team beforehand. |
Are there any objections to using |
I'm ambivalent on a changelog entry since the SHA computation isn't something you usually think too much about. Can't think of objections--they say they're compatible with the stdlib version, so as long as they don't break that I wouldn't expect issues. Should we not also use this elsewhere we're currently using |
2501474
to
6d0ea66
Compare
I've added the changelog entry as that's something that people may refer to in case we'll observe performance gains.
We should definitely consider this but first: measure! Add a benchmark, gather some data points (so that it's visible at: https://kong.github.io/kubernetes-ingress-controller/dev/bench/) and then propose a patch so that we can observe the change (and claim the bragging rights). |
What this PR does / why we need it:
Use
gojson
to marshal config to JSON to get config SHA.This speeds up the marshalling of config to JSON by about 35%, using roughly the same amount of memory and the same amount of memory allocations.
Results (run locally):
Results can be observed at https://kong.github.io/kubernetes-ingress-controller/dev/bench/ for 2501474 or at https://github.com/Kong/kubernetes-ingress-controller/actions/runs/5377294841
Special notes for your reviewer:
PR Readiness Checklist:
Complete these before marking the PR as
ready to review
:CHANGELOG.md
release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR