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

Var store optimize more #3127

Merged
merged 17 commits into from May 25, 2023
Merged

Var store optimize more #3127

merged 17 commits into from May 25, 2023

Conversation

behdad
Copy link
Member

@behdad behdad commented May 25, 2023

No description provided.

@behdad
Copy link
Member Author

behdad commented May 25, 2023

I'm happy with this code now. It was due for a refresh!

Copy link
Contributor

@cmyr cmyr left a comment

Choose a reason for hiding this comment

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

Okay I mostly justed used this as an excuse to familiarize myself with ItemVariationStore.

Out of curiosity, do we have a sense of the savings provided this optimization?

best_idx = i
best_gain = combined_gain - separate_gain
heap = []
for i, other_encoding in enumerate(todo):
Copy link
Contributor

Choose a reason for hiding this comment

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

i'm confused here, are we ever using other_encoding? it looks like we rebind it in the next loop without having touched it. Maybe it was supposed to be encoding, and then you wouldn't need to manually bind that, below?

Copy link
Member Author

Choose a reason for hiding this comment

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

You are correct.

@behdad
Copy link
Member Author

behdad commented May 25, 2023

Okay I mostly justed used this as an excuse to familiarize myself with ItemVariationStore.

Out of curiosity, do we have a sense of the savings provided this optimization?

Honestly not much. In the few kilobytes range. For NotoSans-VF it's 10kb; Roboto-Flex it's 14kb.

@behdad behdad merged commit bf77873 into main May 25, 2023
10 checks passed
@behdad behdad deleted the varStore-optimize-more branch May 25, 2023 18:44
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