Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/Benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ jobs:
with:
dotnet-version: '10.x'
- run: dotnet run -p CSharpMath.Rendering.Benchmarks
- name: Font profile smoke
run: dotnet run -c Release --project CSharpMath.Rendering.Benchmarks/CSharpMath.Rendering.Benchmarks.csproj -- --font-profile --font-profile-smoke --font-profile-output .fontprofile/font-profile-smoke.json
- name: Store font profile smoke
uses: actions/upload-artifact@v4
with:
name: font-profile-smoke
path: .fontprofile/font-profile-smoke.json
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
Expand All @@ -25,4 +32,4 @@ jobs:
alert-threshold: 155% # Should not be lower than 155% to take account of fluctuations of CI load, see https://github.com/verybadcat/CSharpMath/pull/156#commitcomment-42067078
comment-on-alert: true # Show alert with commit comment on detecting possible performance regression
fail-on-alert: true
alert-comment-cc-users: '@Happypig375'
alert-comment-cc-users: '@Happypig375'
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<None Include="..\CSharpMath.Rendering.Tests\ComicNeue_Bold.otf" Link="ComicNeue_Bold.otf" CopyToOutputDirectory="PreserveNewest" />
<Compile Include="..\CSharpMath.Rendering.Tests\TestRenderingMathData.cs" Link="TestRenderingMathData.cs" />
<Compile Include="..\CSharpMath.Rendering.Tests\TestRenderingSharedData.cs" Link="TestRenderingSharedData.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.15.8" />
<ProjectReference Include="../CSharpMath.SkiaSharp/CSharpMath.SkiaSharp.csproj" />
</ItemGroup>
</Project>
</Project>
27 changes: 27 additions & 0 deletions CSharpMath.Rendering.Benchmarks/FontProfiling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Font profiling artifact

Run `dotnet run -c Release -p CSharpMath.Rendering.Benchmarks -- --font-profile`. Use
`--font-profile-samples`, `--font-profile-iterations`, and `--font-profile-batches` to control work,
or `CSHARP_MATH_FONT_PROFILE_OUTPUT` / `--font-profile-output` for the output path. Invoke
`--font-profile-smoke` with or without `--font-profile`; it is a cheap deterministic correctness
check for CI.

The artifact reports raw samples for direct per-resource SFNT parsing, separate first-math and
first-mixed cold workers, global rendering, and alternating formula/font batches. It records bytes
allocated by the managed runtime and bytes retained after a forced GC; process working set is not
used as managed retention. The three embedded faces are loaded by identity and hashed from their
actual bytes. The tracked Comic Neue asset is a real runtime `LocalTypeface`. Table tags are parsed
from each SFNT directory; CFF/glyf and hint/instruction, MATH, GSUB, GPOS, and GDEF presence can be
read directly from `tables`. The `packaging` object reports the measured bundled-font, custom-asset,
rendering-assembly, and generated-font-data fields for the current build. `exercisedPaths`,
`switchingSequence`, and `globalFaces` identify operations actually performed; each `globalFaces`
entry includes the cmap-validated corpus, LocalTypeface usage, and successful draw evidence.
Parse-only table inventory is not presented as outline/cache execution evidence.

Compare distributions and batch retained-memory trends, not thresholds: OS, runtime, Skia, and
process startup noise affect measurements. The artifact helps investigate font startup and cache
growth discussed by issues #107 and #191; it does not prove causality or impose a performance gate.

Captured smoke result (Release, .NET 10 on the development Windows host): 10 raw samples (three
parse-only faces, three rendered bundled-face scenarios, first math, first mixed text, global
alternation, and custom Comic Neue), four font inventories, and zero worker or schema errors.
Loading
Loading