-
-
Notifications
You must be signed in to change notification settings - Fork 531
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
Speed up config.__getattr__ with a factor 10 corresponding to 5-10% app speed up. #5851
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5851 +/- ##
===========================================
+ Coverage 72.36% 83.90% +11.54%
===========================================
Files 290 290
Lines 42236 42264 +28
===========================================
+ Hits 30562 35460 +4898
+ Misses 11674 6804 -4870
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 87 files with indirect coverage changes 📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
I cannot do more now. The implementation is quite complicated. Maybe it should really be refactored? For example I don't understand why you want to ask again and again for the os.environ values. Why not set them once on startup? I am not aware I've broken anything and the tests pass. I hope you will review and finalize. This needs your knowledge @philippjfr . Thanks. |
Thanks for looking at this, refactoring |
Certainly |
Closes #5850
Pytest
I've run the below test on the
main
branch andthis
branch.I've achieved a 75% speed up. Left is
main
branch, Right isthis
branchApp
Compared to the profiling of the app in the reported issue, it looks much better.
config.__getattribute__
is only in one place with a smaller proportion of 1% compared to the 11% before. Still I think that is too much.