-
Notifications
You must be signed in to change notification settings - Fork 75
Slow deepcopy #247
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
Comments
Hello @nosammai Thanks for reporting this issue and your investigation. It looks like you hit the same issue which exists in the synchronous client: kubernetes-client/python#1921 You can use your workaround, it safe for me too. |
Thanks for the info @tomplus, looking forward to the official fix! would you prefer to keep this issue open in case others run into similar problems or close it out? |
I agree, let's keep it opened. |
As I decided not to upgrade the generator for now so I've applied a patch for it. It'll be available in the next release. |
Hello!
I have been running into some issues with CPU usage on my app that is doing some big/busy watches. I ran a profile and noticed that the deepcopy of the Configuration object in the openapi generated client is taking up the majority of the CPU time, as well as the rebuilding of the loggers that it subsequently triggers.
I tested disabling the copy of the Configuration by replacing this line with
return cls._default
, and it reduced the startup time of my application by about 7-10x. I have no idea what the ramifications of not copying that object are, but it seems to still be working okay so far.I'm curious if anyone else has run into these perf issues. I'm not sure I am knowledgeable enough to produce an actual fix for this, but was curious of the ramifications of not making that copy. It seems like most of the stuff in that Configuration object is related to the endpoint being connected to, so I'm wondering if it needs to be copied if my application is only connecting to a single kubernetes cluster?
Thanks!
The text was updated successfully, but these errors were encountered: