Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

andersonhc
Copy link
Collaborator

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) and black (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/ folder

  • A 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.

@andersonhc andersonhc requested a review from gmischler as a code owner May 7, 2024 13:55
Copy link
Collaborator

@gmischler gmischler left a 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-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.28%. Comparing base (a313586) to head (ae21192).
Report is 8 commits behind head on master.

❗ Current head ae21192 differs from pull request most recent head 335c4e7. Consider uploading reports for the commit 335c4e7 to get more accurate results

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.
📢 Have feedback on the report? Share it here.

@Lucas-C
Copy link
Member

Lucas-C commented May 24, 2024

test_cell/test_cell_speed_with_long_text is running 50% faster.

Wow, that is quite an improvement!
Good job @andersonhc!
This is very promising 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants