Skip to content

Conversation

@garretrieger
Copy link
Contributor

Preprocess merges are performed prior to closure analysis and the regular merging phase. These merges just merge adjacent segments to a configurable group size that are below a configurable probability threshold. Primary use case for this is to pregroup low probability segments that don't need the more complex analysis due to their low impact on overall cost.

Additionally includes some optimizations to the generation of the "except segment" during closure analysis. Adds an alternate implementation that is faster for small input segments.

The previous implementation could be slow in fonts with a large number of segments since it is O(total number of segments - segments ids), the fast path is roughly O(segment ids). Also includes optimizations to feature tag subtraction implementation.
When enabled this merges adjacent segments below a given probability threshold before any other processing (such as closure analysis) occurs. Can be used to speed up segmenter and merging analysis by premerging low probability segments.
@garretrieger garretrieger merged commit 47f7040 into w3c:main Oct 24, 2025
3 checks passed
@garretrieger garretrieger deleted the closure_opt branch October 24, 2025 17:55
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.

1 participant