-
Notifications
You must be signed in to change notification settings - Fork 416
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
performance drop with GO111MODULE="on" #69
Comments
This might be because go mod will download all the dependencies of the project, rather than looking at the vendor directory (if it hasn't pulled them down already?). May want to try with Just a thought. |
I don't think that's it but I'm not 100% certain. The performance difference can be observed with a populated vendor and module cache just between running So far a viable work around to embrace modules is:
This is a bit hacky, but allows everything to use modules and doesn't have the big performance penalty. Implementation here: |
@BenTheElder Can you try with |
@vincepri feel free to give it a shot in the kind repo, we're still using the workaround detailed above for now. I might not get to this for a bit myself 😅 |
Oops, sorry I missed the other comment above yours which suggested the same. I wonder how this will perform with the latest build of code-generator, which should be using tools/packages to retrieve the modules. I'll update when I can test in CAPI or kind. |
@vincepri do you have a link to an issue/PR about this? Afaik gengo, the main generation tool behind code-generator, would need to move to using tools/packages first and I don't think that's going to happen soon-ish because that would result in breaking lots of existing interfaces. cc @sttts |
@nikhita I think I might have talked too soon 😄. We should definitely get this on the roadmap, maybe with a feature flag and documentation to opt in? |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
FWIW i'm no longer using the vendor / GOPATH workaround in kind, but I've also changed a lot of things:
|
Like from 5m37s to 7s on my laptop. Turning off `GO111MODULE` makes for a huge improvement - see kubernetes/code-generator#69 Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
Like from 5m37s to 7s on my laptop. Turning off `GO111MODULE` makes for a huge improvement - see kubernetes/code-generator#69 Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
/kind bug |
Optimize the API docs generation by disabling the use of Go modules when running the generation tool. This is a workaround for performance issues in the upstream libraries: kubernetes/gengo#147 kubernetes/code-generator#69 Before this workaround: make api-docs 93.87s user 171.98s system 426% cpu 1:02.30 total After the workaround: make api-docs 2.91s user 0.83s system 135% cpu 2.752 total The hack seems worth the 97% improvement for iterating on docs.
Optimize the API docs generation by disabling the use of Go modules when running the generation tool. This is a workaround for performance issues in the upstream libraries: - kubernetes/gengo#147 - kubernetes/code-generator#69 Before this workaround: make api-docs 93.87s user 171.98s system 426% cpu 1:02.30 total After the workaround: make api-docs 2.91s user 0.83s system 135% cpu 2.752 total The hack seems worth the 97% improvement for iterating on docs.
Optimize the API docs generation by disabling the use of Go modules when running the generation tool. This is a workaround for performance issues in the upstream libraries: - kubernetes/gengo#147 - kubernetes/code-generator#69 Before this workaround: make api-docs 93.87s user 171.98s system 426% cpu 1:02.30 total After the workaround: make api-docs 2.91s user 0.83s system 135% cpu 2.752 total The hack seems worth the 97% improvement for iterating on docs.
Could this change landing in Go 1.18 help here? 🤔 |
I don't think so. That issue seems to relate to populating dependencies in the module cache more quickly. Module mode slows the generators significantly independently of that step. |
/close |
@thockin: 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. |
any context around how/why this is closed ? Seems like there was no activity for three years and it was closed - is that it or it was "fixed" somehow ? |
An answer in parts.
IOW, Go's |
thank you for clarification! |
export GO111MODULE="on"
and then run any of the code generators (so fardefaulter-gen
,deepcopy-gen
,conversion-gen
) for a pretty drastic increase in time to run vsexport GO111MODULE="off"
first.I've been converting https://sigs.k8s.io/kind over to modules fully, and observed this performance issue, I've not yet had a chance to dig into why this occurs, but ensuring that module mode is set to off while calling the code generators seems to dramatically improve peformance.
The text was updated successfully, but these errors were encountered: