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

Speculatively promote lookups to extension #2465

Merged
merged 2 commits into from
Dec 8, 2021

Conversation

simoncozens
Copy link
Collaborator

I've been looking at overflow resolution this morning, as it is currently the bane of my life. My font takes around 5 minutes to build, most of which time is taken up with resolving lookup overflows. (Not subtable overflows - lookup overflows.) The reason overflow resolution takes so long is that once an overflow is resolved, fontTools goes back and starts the whole compilation process all over again.

Now. It seems to me that if the offset to lookup N is too big to fit in a ushort, the offset to lookup N+1 is going to be too big as well. In fact, all lookups from lookup N onwards are going to need handling. So rather than handling them one at a time, why not just promote the lot to extension lookups?

Doing this takes my font's build time down to 30 seconds, almost none of which is to do with overflow resolution.

@simoncozens simoncozens marked this pull request as draft December 6, 2021 13:29
@simoncozens simoncozens marked this pull request as ready for review December 6, 2021 19:29
@behdad
Copy link
Member

behdad commented Dec 8, 2021

Now. It seems to me that if the offset to lookup N is too big to fit in a ushort, the offset to lookup N+1 is going to be too big as well. In fact, all lookups from lookup N onwards are going to need handling. So rather than handling them one at a time, why not just promote the lot to extension lookups?

YYYYESSSSSS PLEAAAAAAAAAASE.

@behdad behdad merged commit fa0eae6 into fonttools:main Dec 8, 2021
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

2 participants