googlefonts / googlefonts/fontc

Emit IR slows down the build considerably

Open
#465 0 comments 0 reactions 0 assignees View on GitHub
performance
Dominant language
Rust
Stars
193
Forks
21
Avg merge
1d 20h
Merged PRs (30d)
60

Description

```shell
$ hyperfine --warmup 3 --prepare 'rm -rf build/' 'target/release/fontc --source ../OswaldFont/sources/Oswald.glyphs --emit-ir=false'
Benchmark 1: target/release/fontc --source ../OswaldFont/sources/Oswald.glyphs --emit-ir=false
Time (mean ± σ): 149.9 ms ± 6.2 ms [User: 294.5 ms, System: 310.3 ms]
Range (min … max): 137.8 ms … 159.8 ms 18 runs

$ hyperfine --warmup 3 --prepare 'rm -rf build/' 'target/release/fontc --source ../OswaldFont/sources/Oswald.glyphs'
Benchmark 1: target/release/fontc --source ../OswaldFont/sources/Oswald.glyphs
Time (mean ± σ): 217.9 ms ± 11.6 ms [User: 409.5 ms, System: 1007.0 ms]
Range (min … max): 206.1 ms … 246.1 ms 10 runs
```

My guess, somewhat supported by a glance at flamegraph, is that this is because we block threads to emit IR. Tossing it over to another thread, on the rayon pool or otherwise, might be worth exploring as this would allow the processing threads to proceed.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with the two hyperfine commands shown in the report, comparing fontc with and without --emit-ir. Inspect the flamegraph and the emit-IR execution path to determine whether thread blocking causes the slowdown. Done means reducing the emit-IR performance cost while preserving the generated IR and existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.