Skip to content

gen_display_resources: speed it up #2414

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

Merged
merged 1 commit into from
Dec 19, 2019

Conversation

jepler
Copy link

@jepler jepler commented Dec 19, 2019

It was intended that the f.load_glyphs line was fast and did most of the work. However, it actually didn't, because it's necessary to pass in a code point by number, not by string.

Additionally, a little light layer violation is needed to make the check for missing characters fast. This used to be less important, as no fonts had missing characters. However, it would take an appreciable length of time on the Korean translation when failing to find hundreds of different code points.

Testing performed: built build-circuitplayground_express_displayio/autogen_display_resources.c with ko translation before and after change. verified the file content was identical. Time went from about 7s on my machine to way under 1 second.

It was intended that the `f.load_glyphs` line was fast and did most of
the work.  However, it actually didn't, because it's necessary to pass
in a code point by number, not by string.

Additionally, a little light layer violation is needed to make the check
for missing characters fast.  This used to be less important, as no
fonts had missing characters.  However, it would take an appreciable
length of time on the Korean translation when failing to find hundreds
of different code points.

Testing performed: built
build-circuitplayground_express_displayio/autogen_display_resources.c with ko
translation before and after change.  verified the file content was identical.
Time went from about 7s on my machine to way under 1 second.
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the speedup!

@tannewt tannewt merged commit 773e131 into adafruit:master Dec 19, 2019
@jepler jepler deleted the speedup-gen-display-resources branch November 3, 2021 21:10
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.

2 participants