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

Conversation

@flar
Copy link
Contributor

@flar flar commented Nov 2, 2022

This problem was discovered when some of the benchmarks changed under the LayerStateStack mechanism, it looks like the code in DLRCI::PrerollFinalize was mutating the preroll context cull_rect when it was just wanting to check for intersection due to the use of the wrong SkRect method (intersect instead of intersects). This meant that we would be less likely to cache other DLLayers inside the same sub-tree. Only a layer that saved and restored the cull_rect such as the clip layers or the transform layer would protect against this issue.

This problem will be fixed when the LayerStateStack code eventually goes in as a side effect of relegating the culling to the LSS object, but this PR will introduce the fix earlier so that any benchmarks can be rebased to the new behavior. Then when LSS is finally landed, it should have no incidental impacts on the benchmarks and we can get a clearer picture of how the new mechanism itself affects performance.

@flar flar requested review from JsouLiang and dnfield November 2, 2022 09:48
@flar flar added perf: speed Performance issues related to (mostly rendering) speed perf: memory Performance issues related to memory labels Nov 2, 2022
@flar flar added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 2, 2022
@auto-submit auto-submit bot merged commit e43555a into flutter:main Nov 2, 2022
@flar
Copy link
Contributor Author

flar commented Nov 2, 2022

I'm expecting that the picture_use metrics will increase in some of the benchmarks due to this change. I'm not expecting any golden changes and ideally the rasterization metrics will improve due to increased caching - if they regress then we need to adjust the caching metrics. But, this change at least makes our caching logic more rational so it shouldn't be viewed as the "cause" of any regressions - merely uncovering some cases where we might need to adjust the metrics...

@zanderso
Copy link
Member

zanderso commented Nov 4, 2022

@flar
Copy link
Contributor Author

flar commented Nov 4, 2022

I thumbs-upped the comments that I reviewed for "expectation".

Hopefully there was no regression on rendering performance as a result (and one would hope that there was an improvement, otherwise we might want to revisit our caching metrics - though if these increases were in the "worst" category then it may have happened during too few frames to impact the benchmark-long timing numbers).

@flar
Copy link
Contributor Author

flar commented Nov 4, 2022

Hmmm, new_gallery_transition_ios increased the picture count in the average which means it should likely be associated with a benchmark render improvement otherwise those additional cache uses are just a memory-intensive wash...

@flar
Copy link
Contributor Author

flar commented Nov 4, 2022

new_gallery_crane was a 99% change so that probably wouldn't affect the frame timings by much.

schwa423 pushed a commit to schwa423/engine that referenced this pull request Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App perf: memory Performance issues related to memory perf: speed Performance issues related to (mostly rendering) speed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants