Reuse pending_layers between frames
From profiling and Pinpoint tests, a decent percentage of PushPaintArtifactToCompositor() CPU time (possibly up to ~30%) is spent reallocating Vector<> objects. Specifically in two places: the chunks_ vector in PaintChunker, and the pending_layers vector in PaintArtifactCompositor. Previous to this CL, on each frame, both vectors were constructed from scratch, grown up to their final size (with many reallocations along the way), used, and then destroyed. This CL tries to reduce a bit of that overhead by keeping the vectors around, at their prior-frame capacity. This CL re-uses the pending_layers vector. The PaintChunker CL is at [1]. [1] https://chromium-review.googlesource.com/c/chromium/src/+/1586578 Bug: 954961 Change-Id: I496259f06835989d2e25b7ce1eb73ef2ab9cc788 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1585330 Commit-Queue: Mason Freed <masonfreed@chromium.org> Commit-Queue: Philip Rogers <pdr@chromium.org> Reviewed-by:Philip Rogers <pdr@chromium.org> Auto-Submit: Mason Freed <masonfreed@chromium.org> Cr-Commit-Position: refs/heads/master@{#654686}
Showing
Please register or sign in to comment