Repository navigation
Improve Performance of TTFunk::Table::OS2#group_original_code_points_by_bit - #83
Merged
pointlessone merged 1 commit intoFeb 1, 2021
Conversation
kokuyouwind
force-pushed
the
improve_group_original_code_points_by_bit
branch
from
June 8, 2020 07:41
950edc9 to
406528d
Compare
Member
|
@kokuyouwind Thank you for your contribution. The numbers look great. @camertron Could you please take a quick look? |
camertron
self-requested a review
June 9, 2020 16:11
camertron
approved these changes
Jun 9, 2020
camertron
left a comment
Member
There was a problem hiding this comment.
Wow, nice! Looks good to me, nice improvement :)
|
is there any progress? i'm looking forward to merging this fix🥺 |
pointlessone
approved these changes
Jan 5, 2021
Member
|
@kokuyouwind Could you please rebase your branch on top of the current master? |
…by_bit Original Code takes O(N * M) time where N is UNICODE_RANGES size and M is code_map keys size Improved Code takes O(MAX(N, M)) time
kokuyouwind
force-pushed
the
improve_group_original_code_points_by_bit
branch
from
January 7, 2021 08:20
406528d to
461c00b
Compare
Contributor
Author
|
@pointlessone OK, rebased. |
|
@pointlessone @camertron or somebody authorized, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Abstruct
fix #82
Original code takes
O(N * M)time where N is UNICODE_RANGES size and M is code_map keys size.Improved code takes
O(max(N, M))time.Idea
Original code calls
r.cover?with all pair ofUNICODE_RANGESandcode_map keys.This takes
O(N * M)time.If
UNICODE_RANGESandcode_map keysare both sorted, firstUNICODE_RANGEcontains somecode_map keysof the head flagment (or empty), nextUNICODE_RANGEcontains next flagment, and so on.This storategy loops
UNICODE_RANGESandcode_map keysindivisualy, so it takesO(max(N, M))time.Performance Test Result
I measure
Problem: TTFunk::Subset#encodetime with #82 reproduction code.(English Font changed to 'spec/fonts/DejaVuSans.ttf')It's about 8x faster than master branch, still 4x slower than 1.5.1 branch.