[read-fonts] Inline AAT lookup format dispatch - #2109
Open
behdad wants to merge 1 commit into
Open
Conversation
Allow format-group inputs to request an inline FontRead dispatcher, and use it for AAT Lookup. This exposes the small format switch across the read-fonts crate boundary without affecting OpenType format groups. Assisted-by: OpenAI Codex <codex@openai.com>
behdad
force-pushed
the
perf/inline-aat-lookup-read
branch
from
September 6, 2026 21:57
8061d37 to
0f545d7
Compare
Contributor
|
Interesting that adding inline on all format groups causes a regression. I can only guess that LTO is choosing not to inline coverage and classdef reads as I believe those are the only ones we touch on the OT hot path. Was the regression on Amiri? |
Contributor
Author
Yeah as I pushed agents to close more gaps between HB & HR, code gen & inlining decisions showed more and more. I'm open to either option. |
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.
Motivation
HarfRust repeatedly reconstructs AAT class-lookup views while applying
morxsubtables. The generatedLookup::read_with_argsformat switch issmall, but without an inline hint it remains opaque across the
read-fontscrate boundary.Add an opt-in
#[read_inline]codegen annotation and use it only for theAAT
Lookupformat group. I tested adding the hint to every format group,but that caused a measurable regression in an OpenType workload, so this
keeps the change narrowly scoped.
Performance
With release LTO builds of HarfRust and
benchmark-harf:fa-words.txten-thelittleprince.txten-thelittleprince.txtOn Devanagari Sangam /
hi-words.txt, fixed-iteration hardware countersdropped from 891,866,354 to 879,745,089 instructions. Cycles are sensitive
to final code layout but were about 1–3% lower in repeated runs.
Testing
cargo test --workspace