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
perf(vello_common): Cull Bèziers path elements during flattening
This conservatively checks whether Bèzier path elements we're about to
flatten are outside the viewport. If they are fully to the right, top,
or bottom of the viewport, the Bèzier does not impact pixel coverage or
coarse winding at all, and can be ignored.
If it is fully to the left, it does impact pixel coverage and coarse
winding, but only the element's start and endpoint y-values matter, not
the exact shape, meaning we can just yield a line rather than finely
flattening.
If more or less everything ends up to be in the viewport, the additional
calculation is wasted and increases flattening time by ~3%.
If geometry ends up culled, flattening and tiling times can be reduced
significantly, but this is of course workload-dependent.
The following two Ghostscript Tiger's have their viewboxes reduced to
`50 50 100 100` and `90 90 20 20`, down from `0 0 200 200`. Their
flattening time is reduce by 52% and 90% respectively, and their tiling
time by 22% and 60%.
Flattening timings:
```
flatten/Ghostscript_Tiger
time: [209.94 µs 210.21 µs 210.51 µs]
change: [+2.6850% +3.1753% +3.6309%] (p = 0.00 < 0.05)
Performance has regressed.
Found 5 outliers among 100 measurements (5.00%)
4 (4.00%) high mild
1 (1.00%) high severe
flatten/Ghostscript_Tiger-viewboxed
time: [97.189 µs 97.287 µs 97.399 µs]
change: [-52.787% -52.650% -52.514%] (p = 0.00 < 0.05)
Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
6 (6.00%) high mild
2 (2.00%) high severe
flatten/Ghostscript_Tiger-viewboxed-extreme
time: [19.722 µs 19.741 µs 19.761 µs]
change: [-90.311% -90.280% -90.255%] (p = 0.00 < 0.05)
Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
7 (7.00%) high mild
1 (1.00%) high severe
flatten/paris-30k time: [12.740 ms 12.764 ms 12.788 ms]
change: [+2.6014% +3.3631% +4.0837%] (p = 0.00 < 0.05)
Performance has regressed.
Found 3 outliers among 100 measurements (3.00%)
3 (3.00%) high mild
```
Tiling timings:
```
tile/Ghostscript_Tiger time: [175.39 µs 175.79 µs 176.28 µs]
change: [-0.4403% -0.0016% +0.4400%] (p = 1.00 > 0.05)
No change in performance detected.
Found 1 outliers among 50 measurements (2.00%)
1 (2.00%) high mild
tile/Ghostscript_Tiger-viewboxed
time: [78.932 µs 79.147 µs 79.409 µs]
change: [-23.209% -22.803% -22.369%] (p = 0.00 < 0.05)
Performance has improved.
Found 5 outliers among 50 measurements (10.00%)
1 (2.00%) high mild
4 (8.00%) high severe
tile/Ghostscript_Tiger-viewboxed-extreme
time: [13.378 µs 13.390 µs 13.405 µs]
change: [-60.417% -60.306% -60.199%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 50 measurements (12.00%)
2 (4.00%) high mild
4 (8.00%) high severe
tile/paris-30k time: [20.970 ms 21.001 ms 21.034 ms]
change: [-0.4881% -0.2397% +0.0108%] (p = 0.07 > 0.05)
No change in performance detected.
Found 1 outliers among 50 measurements (2.00%)
1 (2.00%) high mild
```
0 commit comments