Skip to content

Optimize setIsVolatile for Path #58870

@liyuqian

Description

@liyuqian

Internal: b/174239851

We had some performance issue that's related with SkPath::setIsVolatile before: #17889. That issue was closed because Skia introduced CCPR and it has a nice performance even without setIsVolatile.

Unfortunately, CCPR was later disabled #17889 (comment) and we're seeing this issue again.

In particular, here's a comparison of our cubic_bezier_perf__timeline_summary benchmark with and without setIsVolatile (using 8b201b9 and flutter/engine@1482d9b):

without setIsVolatile with setIsVolatile
90th_percentile_frame_rasterizer_time_millis 24.108 13.95
99th_percentile_frame_rasterizer_time_millis 47.098 18.366

In addition to the speed improvement, setIsVolatile(true) should also improve the memory usage as Skia will no longer cache the volatile paths.

As path animations get more and more popular through Rive/Flare among our customers such as "customer: money (g3)" and "customer: dream (g3)", having setIsVolatile may become more and more beneficial (see, e.g., #57686).

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressionc: performanceRelates to speed or footprint issues (see "perf:" labels)customer: dream (g3)customer: money (g3)engineflutter/engine related. See also e: labels.perf: memoryPerformance issues related to memoryperf: speedPerformance issues related to (mostly rendering) speedwaiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions