googlefonts / shaperglot

Test font files for language support
Apache License 2.0
29 stars 4 forks source link

Make it faster #9

Closed simoncozens closed 1 year ago

simoncozens commented 1 year ago

Need a speedup of about 60x.

NeilSureshPatel commented 1 year ago

Not sure if this is a useful, but I was thinking that for a lot of the tests we want we are looking at the same input string. For example running an orthographies check and then repeating it with smcp enabled. It makes me wonder if there is a run time benefit to not reloading the input string between those tests.

simoncozens commented 1 year ago

Right, or caching the results. Or shaping all the characters at once with Harfbuzz, and then sorting out the results. There are lots of things we can do.

simoncozens commented 1 year ago

One reason you're finding shaperglot slow is that you're running a new Python process (loading all the libraries, reading the font, etc.) for each script. I'll send you a PR which uses shaperglot as a library; that should speed things up significantly.

NeilSureshPatel commented 1 year ago
Thanks Simon. Just gave it a run and its super fast.  From: Simon CozensSent: Friday, November 4, 2022 5:24 AMTo: simoncozens/shaperglotCc: Neil S Patel; CommentSubject: Re: [simoncozens/shaperglot] Make it faster (Issue #9) One reason you're finding shaperglot slow is that you're running a new Python process (loading all the libraries, reading the font, etc.) for each script. I'll send you a PR which uses shaperglot as a library; that should speed things up significantly.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>