Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

yjbanov
Copy link
Contributor

@yjbanov yjbanov commented Apr 15, 2020

Optimizes picture recording by speeding up paint bounds estimation:

  • Avoid allocating temporary matrices and vectors on the _PaintBounds hot paths.
  • Remove dynamism in vector math.

Here's the A/B comparison on the bench_picture_recording benchmark (see flutter/flutter#54908):

Score	Average A (noise)	Average B (noise)	Speed-up
bench_picture_recording.html.recordPaintCommands.average	3393.82 (3.49%)	1755.48 (3.53%)	1.93x	
bench_picture_recording.html.estimatePaintBounds.average	0.00 (0.00%)	3.01 (15.88%)	0.00x

(i.e. it speeds it up by ~2x)

Update (2020-04-22): the change has propagated to the benchmark and the results confirm that the optimization is effective.

growLTRB-optimization

@yjbanov yjbanov force-pushed the optimize-paint-bounds branch from d8cbf45 to cb134b8 Compare April 15, 2020 23:05
@yjbanov yjbanov changed the title reuse the intermediate matrix in transformLTRB remove allocation from growLTRB; remove dynamism in vector_math Apr 15, 2020
@yjbanov yjbanov requested a review from ferhatb April 15, 2020 23:07
@yjbanov yjbanov marked this pull request as ready for review April 15, 2020 23:07
@auto-assign auto-assign bot requested a review from cbracken April 15, 2020 23:07
@yjbanov
Copy link
Contributor Author

yjbanov commented Apr 22, 2020

Updated the description with benchmark results from the devicelab now that this change propagated to the framework.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants