Reduce realloc overhead in wpf-gpu-raster
Categories
(Core :: Graphics: Canvas2D, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox109 | --- | fixed |
People
(Reporter: lsalzman, Assigned: lsalzman)
References
(Blocks 2 open bugs)
Details
Attachments
(2 files)
We spend a substantial amount of time in wpf-gpu-raster (and also aa-stroke sometimes) reallocing/shrinking the vertex buffer. This can show as up to 10% of release profiles. Additionally, we spend a lot of time memmove-ing out of this buffer into shared memory, but that is probably best dealt with in a follow-up. However, the changes in this bug will at least lay some groundwork for further optimizing the shared memory situation later.
Example demos -
https://js1k.com/2013-spring/demo/1390
https://codepen.io/DonKarlssonSan/pen/KKoaRrY
Assignee | ||
Comment 1•2 years ago
|
||
This adds machinery to wpf-gpu-raster and aa-stroke to support an output buffer specified as
a slice, which they will preferentially use instead of their dynamic Vec to store output
vertexes in.
Assignee | ||
Comment 2•2 years ago
|
||
This pre-allocates a vertex output buffer in DrawTargetWebgl so that we can generate
wpf-gpu-raster and aa-stroke output into it. This way, they don't have to realloc
a Vec for pushes or changing into a boxed slice. This can net 5-10% on profiles for
the demos noted in the bug.
Depends on D163989
Comment 4•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/24d7f14d347c
https://hg.mozilla.org/mozilla-central/rev/99052dd249cc
Description
•