[flutter_runner] Add Skia graphics resource cache tuning advice
Add a comment with advice on how to tune the Skia graphics resource
cache size.
FL-153 #comment
Change-Id: I3e505ed3ef03061a1d61af0c78e2671b0c57aa55
diff --git a/runtime/flutter_runner/vulkan_surface_producer.cc b/runtime/flutter_runner/vulkan_surface_producer.cc
index 179a078..ef35e5d 100644
--- a/runtime/flutter_runner/vulkan_surface_producer.cc
+++ b/runtime/flutter_runner/vulkan_surface_producer.cc
@@ -22,8 +22,16 @@
namespace {
-// TODO(FL-153): Properly tune these values.
constexpr int kGrCacheMaxCount = 8192;
+// Tuning advice:
+// If you see the following 3 things happening simultaneously in a trace:
+// * Over budget ("flutter", "GPURasterizer::Draw") durations
+// * Many ("skia", "GrGpu::createTexture") events within the
+// "GPURasterizer::Draw"s
+// * The Skia GPU resource cache is full, as indicated by the
+// "SkiaCacheBytes" field in the ("flutter", "SurfacePool") trace counter
+// (compare it to the bytes value here)
+// then you should consider increasing the size of the GPU resource cache.
constexpr size_t kGrCacheMaxByteSize = 16 * (1 << 20);
} // namespace