fontations icon indicating copy to clipboard operation
fontations copied to clipboard

[read-fonts] inline all the things

Open dfrg opened this issue 4 months ago • 3 comments

Just adds a bunch of #[inline] attributes to codegen'd functions.

dfrg avatar Aug 05 '25 17:08 dfrg

Haha. Nice one. Will measure soon.

behdad avatar Aug 05 '25 17:08 behdad

On Mac I don't see any change whatsoever. On Linux, I actually see 5% slowdown on the ligature-heavy BM_Shape/SourceSerifVariable-Roman.ttf/react-dom.txt/harfrust benchmark and 1% slowdown in other benches.

I'm okay merging, but looks like our config https://github.com/harfbuzz/harfbuzz/blob/main/src/rust/Cargo.toml already does a good job of inlining.

Perhaps the config should be documented in the HR repo itself, or enabled there by default.

behdad avatar Aug 05 '25 18:08 behdad

On Linux, I actually see 5% slowdown on the ligature-heavy BM_Shape/SourceSerifVariable-Roman.ttf/react-dom.txt/harfrust benchmark and 1% slowdown in other benches.

I rebuilt with release mode, which means codegen-units 1 instead of 16, and I see no perf diff whatsoever. So, LGTM.

behdad avatar Aug 05 '25 19:08 behdad