Skip to content

Precompute rounded vertices#1547

Merged
emilk merged 5 commits intomasterfrom
precompute-vertices
Apr 30, 2022
Merged

Precompute rounded vertices#1547
emilk merged 5 commits intomasterfrom
precompute-vertices

Conversation

@emilk
Copy link
Copy Markdown
Owner

@emilk emilk commented Apr 30, 2022

Precomputes the vertices for rounded corners and circles.

I see around 15% improvement in cargo bench demo_only_tessellate (76.4ms -> 64.6ms)

Closes #1507

dbuch and others added 5 commits April 30, 2022 12:53
Before:
demo_with_tessellate__realistic
                        time:   [328.77 us 329.22 us 329.70 us]
                        change: [-2.6116% -1.1978% +0.2520%] (p = 0.10 > 0.05)
                        No change in performance detected.

demo_no_tessellate      time:   [164.67 us 165.82 us 167.30 us]

demo_only_tessellate    time:   [159.34 us 159.85 us 160.67 us]

After:
demo_with_tessellate__realistic
                        time:   [309.48 us 309.92 us 310.41 us]
                        change: [-7.1042% -5.6164% -4.0262%] (p = 0.00 < 0.05)
                        Performance has improved.

demo_no_tessellate      time:   [160.44 us 161.30 us 162.49 us]
                        change: [-4.5692% -2.8617% -1.3549%] (p = 0.00 < 0.05)
                        Performance has improved.

demo_only_tessellate    time:   [139.45 us 140.23 us 141.25 us]
                        change: [-13.637% -12.245% -10.695%] (p = 0.00 < 0.05)
                        Performance has improved.

Not sure this is the right path. So i didn't bother to port Path::add_point()

Also we might want to fallback to computed vertices for radii >= 20 or add
another precomputed batch.
@emilk emilk changed the title Precompute vertices Precompute rounded vertices Apr 30, 2022
@emilk emilk merged commit 8303523 into master Apr 30, 2022
@emilk emilk deleted the precompute-vertices branch April 30, 2022 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants