-
Notifications
You must be signed in to change notification settings - Fork 269
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
Improve performance working with unicode fonts (#907) #1158
Conversation
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.
This is an very interesting approach.
We should probably test this with some longish text in chinese/japanese, or with a multilingual font. I suspect that a cache size of 128 is far too small in those cases (and I don't think increasing it will hurt anything with smaller alphabets).
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1158 +/- ##
==========================================
+ Coverage 93.27% 93.28% +0.01%
==========================================
Files 30 30
Lines 9228 9250 +22
Branches 2103 2105 +2
==========================================
+ Hits 8607 8629 +22
- Misses 379 382 +3
+ Partials 242 239 -3 ☔ View full report in Codecov by Sentry. |
Wow, that is quite an improvement! |
Test command: pytest test/text/test_cell.py::test_cell_speed_with_long_text --durations=0 pypi (latest release)
Current master:
PR branch:
|
Thank you and good job for this @andersonhc! 👍 |
I am doing some tests using functools cache to improve performance working with unicode fonts.
test_cell/test_cell_speed_with_long_text is running 50% faster.
I will do additional tests soon.
Checklist:
The GitHub pipeline is OK (green),
meaning that both
pylint
(static code analyzer) andblack
(code formatter) are happy with the changes of this PR.A unit test is covering the code added / modified by this PR
This PR is ready to be merged
In case of a new feature, docstrings have been added, with also some documentation in the
docs/
folderA mention of the change is present in
CHANGELOG.md
By submitting this pull request, I confirm that my contribution is made under the terms of the GNU LGPL 3.0 license.