You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 97ec787
Browse filesBrowse the repository at this point in the historyBrowse files
Reduce first car render latency and add paired fresh-process benchmarks
Extract byte decoding, color conversion and final encoding into named pure
numeric kernels, preserving arithmetic, alpha handling and float rounding.
On current .NET 6/7/8 targets, optimize the seven measured numeric kernels
at their first call rather than waiting for tiered-JIT promotion. Leave the
rest of the runtime policy unchanged and retain normal JIT behavior on the
older framework targets. No rendering warmup or global runtime setting is used.
Defer TextStyle's shared FontResolver through a thread-safe Lazy instance:
geometry-only SVGs and inherited font declarations no longer require building
the system font catalog. First real text still resolves the same typeface.
Skip the CSS importance regex when the value contains no exclamation mark.
Add a cold-car benchmark with a fresh hidden child process for every trial,
background-STA parse/preview/freeze/full-render phases, parent process-to-ready
measurements and cross-thread frozen drawing validation. Pair baseline and
candidate processes in alternating AB/BA order. Support repository override
when copying harness binaries to the same drive. Check preview, native-size
full output and every native bitmap hash after readiness timing completes.
Update changelog and performance documentation before this commit. Retain
individual paired samples, medians, warmed checks and methodology in raw JSON.
Source sampling, blur radii/edge behavior, filter effects and quality are unchanged.
Same-host .NET 8, five fresh-process pairs against 06c5cca, binaries on the same
drive and OS caches retained:
- Full progressive pipeline: 2184.32 -> 1517.85 ms.
- Process launch to full readiness: 2295.52 -> 1628.66 ms (about 29% shorter).
- Preview readiness within pipeline: 262.07 -> 288.72 ms; no preview-speed claim.
- All five previews and full 900x600 outputs match, including all 70 native
filter bitmaps. All twelve warmed workloads retain matching image hashes.
Record the startup tradeoff explicitly: warmed timings varied. The stored
same-drive car check measured load at 1.52 -> 1.08 s and redraw at 1.07 -> 1.21 s.
These changes favor first filtered readiness; they do not guarantee a warmed
throughput improvement. Allocation/timing and OS-cache limits are documented.
Validation:
- New startup tests verify lazy font state for geometry-only SVGs and typeface
initialization / glyph output for first real text.
- Complete native WPF regressions and all 321 selected resvg checks pass
(312 image comparisons and nine historical/undefined render-only cases).
- All 14 external animation examples advance without warnings.
- Existing exact blur/convolution/encoding and shared-input checks pass.
- All nine library/example target builds and DocFX pass with zero warnings/errors.
- Staged whitespace check passes; downloaded fixtures remain outside the repo.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,10 @@ These entries describe the current repository source. They have not been assigne
10
10
11
11
#### Performance
12
12
13
+
-**Cold progressive rendering:** extract byte decoding, color conversion and encoding into named kernels and compile seven profiled numeric kernels with first-call optimization on the current .NET 6/7/8 targets. Other code retains normal tiered optimization; older targets retain their usual JIT behavior. Geometry-only SVGs defer the thread-safe font catalog until a typeface is actually requested. CSS values without `!` skip the importance regex.
14
+
- Add a fresh-process car benchmark with parse/preview/filter/freeze phases, parent process-to-ready timing, alternating baseline/candidate trial order and full preview/image/native-bitmap hashes. Five paired .NET 8 trials against `06c5cca`: full pipeline 2.18 s → 1.52 s; process launch to full readiness 2.30 s → 1.63 s. Preview readiness was 262 → 289 ms. All previews, native-size complete images and 70 filter bitmaps match exactly.
15
+
- Record the startup tradeoff in the performance guide: warmed timings varied, and the recorded warmed redraw was 1.07 s → 1.21 s. Add regression checks that geometry-only rendering leaves the font catalog uninitialized and first real text still resolves/renders its typeface correctly.
16
+
13
17
-**Further car optimization:** process blur columns through tiled transposition and contiguous row kernels; retain identical sliding-sum order, box radii, edge handling and sampling resolution. Black/white/grayscale inputs skip duplicate channel arithmetic. Large numeric buffers use at most four-way parallelism; WPF objects stay on the calling STA and small buffers stay serial.
14
18
- Fuse native pixel decoding with the initial color conversion for sole SourceGraphic Gaussian filters, and let those filters donate their temporary input as scratch. Multi-primitive/shared-input graphs retain immutable inputs. Fuse final sRGB conversion and byte encoding while preserving intermediate float rounding, removing another full float-frame allocation.
15
19
- Same-host .NET 8 five-run medians against `dd6ade6`: car load 5.07 s → 1.12 s; redraw 5.16 s → 0.94 s. Caller-thread managed allocation fell from 1.38 GB to 643 MB for load. The 900×600 car output and all 70 native filter bitmaps match exactly, as do all twelve benchmark workloads. Raw results and methodology are recorded in the performance guide; timings are machine/workload specific.
Copy file name to clipboardExpand all lines: Docs/Performance.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,24 @@ A separate fresh-process progressive-loading check published its unfiltered prev
59
59
60
60
These are elapsed-time medians with a warmup, not a guarantee for every host or cold start. Allocation counters cover the caller thread; worker-thread bookkeeping, native buffers and GPU allocations are excluded. In particular, the allocation columns are not peak-memory measurements. The benchmark runs complete baseline and candidate processes serially without other builds/tests running.
61
61
62
+
## Cold progressive startup
63
+
64
+
Cold startup now has a separate fresh-process benchmark. Each child times its first parse, unfiltered preview, freeze and complete filtered render on a background STA. The parent stamps preview/full readiness events before validation and hashing. Baseline and candidate binaries use the same drive and alternate trial order. OS disk/font caches are retained.
65
+
66
+
Five paired .NET 8 trials against `06c5cca` on this host:
67
+
68
+
| Metric | Before | After |
69
+
| --- | ---: | ---: |
70
+
| First full pipeline | 2.18 s | 1.52 s |
71
+
| Process launch to full readiness | 2.30 s | 1.63 s |
72
+
| Pipeline preview readiness | 262 ms | 289 ms |
73
+
74
+
The measured gain comes from optimized first-call code for the byte/color kernels and blur kernels on the current .NET 6/7/8 targets. Geometry-only documents also defer the managed font catalog until text requests a typeface; their text-style inheritance stays intact. Ordinary CSS values skip unnecessary importance-pattern matching.
75
+
76
+
This policy favors first filtered readiness. It bypasses tiered compilation for seven pure numeric methods; the rest of the library uses its normal runtime policy. Warmed measurements varied across runs. The recorded same-drive warmed car load was 1.52 s → 1.08 s, while redraw was 1.07 s → 1.21 s. These results include a warmed redraw tradeoff and do not imply uniformly faster steady-state rendering. Older target frameworks retain their usual JIT behavior.
77
+
78
+
All five previews and full 900×600 car images match, including all 70 native filter bitmaps. All twelve warmed benchmark workloads also retain matching thumbnail, 900×600 and native-bitmap hashes. The cold trials render frozen drawings across threads; validation runs after the readiness event. [Raw cold/warm checks and per-phase samples](https://github.com/dotnetprojects/SVGImage/blob/master/Tests/PerformanceBenchmarks/results/2026-11-03-cold-start-net8.json).
0 commit comments