-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Refactoring for potential performance improvements in loops #113
Conversation
Codecov Report
@@ Coverage Diff @@
## master #113 +/- ##
==========================================
+ Coverage 86.19% 86.24% +0.04%
==========================================
Files 11 11
Lines 1188 1185 -3
==========================================
- Hits 1024 1022 -2
+ Misses 164 163 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In quick tests, I did see a minor performance improvement. About 2 ms in average, that not bad.
There some lint errors to fix.
Plus the tests show a warning.
|
Hi @Ousret, I did the changes as requested, I'm not sure what the warning has to do with |
Did you measure that this makes things faster? For one, a common micro-optimization in Python is to alias global variables into locals within functions, since local variable access is faster than global variable access. |
Co-authored-by: Aarni Koskela <akx@iki.fi>
Thanks for the adjustments @adbar , remain a few remarks, but I think this is about it. |
Co-authored-by: TAHRI Ahmed R. <Ousret@users.noreply.github.com>
More a limitation of mypy.
Don't get that you filtered out the None. |
I'm not so proficient with mypy but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* 📝 Update claims * 🔖 Bump version to 2.0.7 * 🐛 Fix regression from PR #113 List instead of Set for alphabets property * fix type output in alphabets property * ✔️ Add test case to ensure non-regression upon 28c3ae1 * ✔️ Add tests and ignore old legacy methods cover * ❇️ Add autofix script for black and isort linters * 📝 Update contrib.md * 🔧 Python 3.10 (using public release) tests
Experiments with ideas to potentially improve performance or code consistency without impacting readability (#111).
This PR:
cd.py
cd.py
md.py
Close #111