-
Notifications
You must be signed in to change notification settings - Fork 6k
Evicting unused cache entries before RasterCache actions #34627
Conversation
af17d91
to
9ef007a
Compare
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. |
cc @flar @JsouLiang |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was one of my most anticipated follow-on opts for the refactor. It's looking good. Some minor nits that I'd like to hear back about before I approve.
Could we provide some benchmarks data? |
BenchmarkI changed the following code, diff --git a/dev/benchmarks/macrobenchmarks/lib/src/cull_opacity.dart b/dev/benchmarks/macrobenchmarks/lib/src/cull_opacity.dart
index 7eb04aedf2..355b95cca9 100644
--- a/dev/benchmarks/macrobenchmarks/lib/src/cull_opacity.dart
+++ b/dev/benchmarks/macrobenchmarks/lib/src/cull_opacity.dart
@@ -41,8 +41,8 @@ class _CullOpacityPageState extends State<CullOpacityPage> with SingleTickerProv
return Stack(children: List<Widget>.generate(50, (int i) => Positioned(
left: 0,
top: (200 * i).toDouble() + _offsetY.value,
- child: Opacity(
- opacity: 0.5,
+ child: ColorFiltered(
+ colorFilter: ColorFilter.mode(Colors.green[300]!, BlendMode.luminosity),
child: RepaintBoundary(
child: Container(
// Slightly change width to invalidate raster cache. And then ran the benchmark result═════════════════════════╡ ••• Final A/B results ••• ╞══════════════════════════ Score Average A (noise) Average B (noise) Speed-up |
I also filed a PR for adding the benchmark flutter/flutter#107918 |
Hey, as an FYI - this utility provided in the framework repo can be used to format the A/B results in a more readable format: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I added the autosubmit label to the benchmark to get it into the working tree ASAP to collect baseline data, but I'll leave it to you to tag this PR at your discretion. During the time that this takes to just roll into the main tree we'll likely get a few samples of baseline, but it would be nice to have a couple dozen so that the regression measuring code has some statistically relevant data to compare against. |
Delete the unused images before generating new cached images.
fix: flutter/flutter#94511
Add new method 'RasterCache::EvictUnusedCacheEntries', called before the LayerTree::TryToRasterCache method to remove cached images that are no longer used.
Tweak
total_count
andtotal_bytes
of theRasterCacheMetrics
.Pre-launch Checklist
writing and running engine tests.
///
).