-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add benchmark for scrolling very long pictures #133434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add benchmark for scrolling very long pictures #133434
Conversation
|
We should have probably added this benchmark back when we fixed #92366 by adding RTrees to DisplayList in flutter/engine#38429 so that we could track a number of changes that were made to the code - some potentially positive, some potentially regressing. In particular, I recently ran a local copy of the benchmark from #92366 and discovered that not only had we lost almost all of the gains, but the app now takes up to 20 seconds to draw its first frame. The root cause is an oversight in an old PR that added fine-grained bounds when drawing one DL into another in flutter/engine#37451 and any case that would cause such a DL -> DL recording. At the time it was added, there weren't any cases where we might do that, but in the intervening time we've added a couple of cases.
When these things happen for the test case mentioned above, 300,000+ drawline calls, that all overlap are iterated and consolidated into a single rectangle somewhat quadratically causing a huge regression. Some work is being done that will reduce some of these cases, including:
After this benchmark lands, I will be landing a 1-line fix for the biggest cause of the regression here - the fact that iterating the rtree bounds inside DlCanvasToReceiver does not provide the cull rect. (see #133437) We should also consider punting on the fine grained bounds for some DisplayLists, particularly if they contain quite a lot of rendering calls. (see #133436) |
82d6484 to
c8516cd
Compare
ab40b36 to
ccc6703
Compare
) Fixes flutter/flutter#133437 With this fix, the [benchmarks](flutter/flutter#133434) for pictures with huge bounds become runnable under more conditions. Currently those benchmarks only run on platforms where we don't run into this issue. The performance on those platforms/conditions will not change much, but with this fix we can run them on Impeller and add a variant that has a platform view on the display.
This benchmark will track the performance of the RTree implementation to cull very large pictures down to just the portion visible on the screen.