Skip to content

Conversation

@wangying3426
Copy link
Contributor

@wangying3426 wangying3426 commented Apr 25, 2022

Benchmark for flutter/engine#32899.

The test result shows that it reduced the rasterizer time by using raster cache to replace saveLayer.

  • If child DisplayListLayers are simple ( isComplex is false ) and not be cached, the result is that 90th percentile rasterizer time reduced. layer cache increased but saveLayer reduced. See:
═════════════════════════╡ ••• Final A/B results ••• ╞══════════════════════════

Score	Average A (noise)	Average B (noise)	Speed-up
average_frame_build_time_millis	1.80 (0.00%)	1.95 (0.00%)	0.92x	
worst_frame_build_time_millis	3.28 (0.00%)	3.58 (0.00%)	0.92x	
90th_percentile_frame_build_time_millis	2.42 (0.00%)	3.03 (0.00%)	0.80x	
99th_percentile_frame_build_time_millis	3.03 (0.00%)	3.51 (0.00%)	0.86x	
average_frame_rasterizer_time_millis	11.77 (0.00%)	3.65 (0.00%)	3.22x	
worst_frame_rasterizer_time_millis	59.87 (0.00%)	6.23 (0.00%)	9.61x	
90th_percentile_frame_rasterizer_time_millis	13.32 (0.00%)	4.50 (0.00%)	2.96x	
99th_percentile_frame_rasterizer_time_millis	15.88 (0.00%)	4.96 (0.00%)	3.20x	
average_layer_cache_count	0.00 (0.00%)	4.00 (0.00%)	0.00x	
90th_percentile_layer_cache_count	0.00 (0.00%)	4.00 (0.00%)	0.00x	
99th_percentile_layer_cache_count	0.00 (0.00%)	4.00 (0.00%)	0.00x	
worst_layer_cache_count	0.00 (0.00%)	4.00 (0.00%)	0.00x	
average_layer_cache_memory	0.00 (0.00%)	5.68 (0.00%)	0.00x	
90th_percentile_layer_cache_memory	0.00 (0.00%)	5.68 (0.00%)	0.00x	
99th_percentile_layer_cache_memory	0.00 (0.00%)	5.68 (0.00%)	0.00x	
worst_layer_cache_memory	0.00 (0.00%)	5.68 (0.00%)	0.00x	
average_picture_cache_count	0.00 (0.00%)	0.00 (0.00%)	NaNx	
90th_percentile_picture_cache_count	0.00 (0.00%)	0.00 (0.00%)	NaNx	
99th_percentile_picture_cache_count	0.00 (0.00%)	0.00 (0.00%)	NaNx	
worst_picture_cache_count	0.00 (0.00%)	0.00 (0.00%)	NaNx	
average_picture_cache_memory	0.00 (0.00%)	0.00 (0.00%)	NaNx	
90th_percentile_picture_cache_memory	0.00 (0.00%)	0.00 (0.00%)	NaNx	
99th_percentile_picture_cache_memory	0.00 (0.00%)	0.00 (0.00%)	NaNx	
worst_picture_cache_memory	0.00 (0.00%)	0.00 (0.00%)	NaNx	
new_gen_gc_count	0.00 (0.00%)	0.00 (0.00%)	NaNx	
old_gen_gc_count	0.00 (0.00%)	0.00 (0.00%)	NaNx
  • If child DisplayListLayers are complex and also cached, the result is that 90th percentile rasterizer time reduced. layer cache increased, but both picture cache and saveLayer reduced. See:
═════════════════════════╡ ••• Final A/B results ••• ╞══════════════════════════

Score	Average A (noise)	Average B (noise)	Speed-up
average_frame_build_time_millis	1.74 (0.00%)	1.70 (0.00%)	1.03x	
worst_frame_build_time_millis	5.17 (0.00%)	3.65 (0.00%)	1.42x	
90th_percentile_frame_build_time_millis	2.10 (0.00%)	2.73 (0.00%)	0.77x	
99th_percentile_frame_build_time_millis	3.90 (0.00%)	3.19 (0.00%)	1.22x	
average_frame_rasterizer_time_millis	9.60 (0.00%)	4.25 (0.00%)	2.26x	
worst_frame_rasterizer_time_millis	20.38 (0.00%)	12.19 (0.00%)	1.67x	
90th_percentile_frame_rasterizer_time_millis	11.02 (0.00%)	7.06 (0.00%)	1.56x	
99th_percentile_frame_rasterizer_time_millis	12.85 (0.00%)	7.63 (0.00%)	1.68x	
average_layer_cache_count	0.00 (0.00%)	4.00 (0.00%)	0.00x	
90th_percentile_layer_cache_count	0.00 (0.00%)	4.00 (0.00%)	0.00x	
99th_percentile_layer_cache_count	0.00 (0.00%)	4.00 (0.00%)	0.00x	
worst_layer_cache_count	0.00 (0.00%)	4.00 (0.00%)	0.00x	
average_layer_cache_memory	0.00 (0.00%)	6.72 (0.00%)	0.00x	
90th_percentile_layer_cache_memory	0.00 (0.00%)	6.72 (0.00%)	0.00x	
99th_percentile_layer_cache_memory	0.00 (0.00%)	6.72 (0.00%)	0.00x	
worst_layer_cache_memory	0.00 (0.00%)	6.72 (0.00%)	0.00x	
average_picture_cache_count	4.00 (0.00%)	0.00 (0.00%)	Infinityx	
90th_percentile_picture_cache_count	4.00 (0.00%)	0.00 (0.00%)	Infinityx	
99th_percentile_picture_cache_count	4.00 (0.00%)	0.00 (0.00%)	Infinityx	
worst_picture_cache_count	4.00 (0.00%)	0.00 (0.00%)	Infinityx	
average_picture_cache_memory	8.72 (0.00%)	0.00 (0.00%)	Infinityx	
90th_percentile_picture_cache_memory	8.72 (0.00%)	0.00 (0.00%)	Infinityx	
99th_percentile_picture_cache_memory	8.72 (0.00%)	0.00 (0.00%)	Infinityx	
worst_picture_cache_memory	8.72 (0.00%)	0.00 (0.00%)	Infinityx	
new_gen_gc_count	0.00 (0.00%)	0.00 (0.00%)	NaNx	
old_gen_gc_count	0.00 (0.00%)	0.00 (0.00%)	NaNx

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@wangying3426 wangying3426 requested a review from keyonghan as a code owner April 25, 2022 10:45
@flutter-dashboard flutter-dashboard bot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Apr 25, 2022
@wangying3426
Copy link
Contributor Author

@flar Could you have time to have a look at this? Thanks.

@flar
Copy link
Contributor

flar commented May 9, 2022

First, this appears to be modifying an existing benchmark. Once a benchmark is added, it should remain stable as its performance history is tracked. If you have new things to benchmark, a new benchmark should be created so that it doesn't interfere with existing metrics.

Second, please run A/B tests with more than 1 iteration so that benchmark jank is averaged out. I typically run AB=4.

@wangying3426
Copy link
Contributor Author

wangying3426 commented May 10, 2022

First, this appears to be modifying an existing benchmark. Once a benchmark is added, it should remain stable as its performance history is tracked. If you have new things to benchmark, a new benchmark should be created so that it doesn't interfere with existing metrics.

Second, please run A/B tests with more than 1 iteration so that benchmark jank is averaged out. I typically run AB=4.

Thank you for reply.

For the this point, clipper_cache_perf__e2e_summary seems to be a new benchmark so that it doesn't interfere with existing metrics.
But, if adds it to an existing benchmark, do you mean that we should modify the shader_mask_cache benchmark? Just like this commit, if it is merged to this PR, the clipper_and_shader_mask_cache test will include both clipper and shader mask benchmarks?

For the second point, the result of AB=4 also shows that the rasterizer time is reduced, see:

{
  "benchmark_type": "A/B summaries",
  "version": "1.0",
  "local_engine": "android_profile",
  "task_name": "clipper_cache_perf__e2e_summary",
  "run_start": "2022-05-10T22:09:00.669800",
  "run_end": "2022-05-10T22:18:58.771409",
  "default_results": {
    "average_frame_build_time_millis": [
      1.228,
      1.011,
      1.093,
      1.058
    ],
    "worst_frame_build_time_millis": [
      4.954,
      2.433,
      2.533,
      2.548
    ],
    "90th_percentile_frame_build_time_millis": [
      1.889,
      1.445,
      1.442,
      1.38
    ],
    "99th_percentile_frame_build_time_millis": [
      4.206,
      2.072,
      2.268,
      2.199
    ],
    "average_frame_rasterizer_time_millis": [
      2.838,
      3.222,
      3.269,
      3.173
    ],
    "worst_frame_rasterizer_time_millis": [
      5.122,
      4.463,
      5.485,
      4.729
    ],
    "90th_percentile_frame_rasterizer_time_millis": [
      3.332,
      3.925,
      3.833,
      3.662
    ],
    "99th_percentile_frame_rasterizer_time_millis": [
      4.243,
      4.282,
      4.25,
      4.259
    ],
    "average_layer_cache_count": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "90th_percentile_layer_cache_count": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "99th_percentile_layer_cache_count": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "worst_layer_cache_count": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "average_layer_cache_memory": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "90th_percentile_layer_cache_memory": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "99th_percentile_layer_cache_memory": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "worst_layer_cache_memory": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "average_picture_cache_count": [
      3.0,
      3.0,
      3.0,
      3.0
    ],
    "90th_percentile_picture_cache_count": [
      3.0,
      3.0,
      3.0,
      3.0
    ],
    "99th_percentile_picture_cache_count": [
      3.0,
      3.0,
      3.0,
      3.0
    ],
    "worst_picture_cache_count": [
      3.0,
      3.0,
      3.0,
      3.0
    ],
    "average_picture_cache_memory": [
      4.990150451660156,
      4.990150451660156,
      4.990150451660156,
      4.990150451660156
    ],
    "90th_percentile_picture_cache_memory": [
      4.990150451660156,
      4.990150451660156,
      4.990150451660156,
      4.990150451660156
    ],
    "99th_percentile_picture_cache_memory": [
      4.990150451660156,
      4.990150451660156,
      4.990150451660156,
      4.990150451660156
    ],
    "worst_picture_cache_memory": [
      4.990150451660156,
      4.990150451660156,
      4.990150451660156,
      4.990150451660156
    ],
    "new_gen_gc_count": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "old_gen_gc_count": [
      0.0,
      0.0,
      0.0,
      0.0
    ]
  },
  "local_engine_results": {
    "average_frame_build_time_millis": [
      1.147,
      1.123,
      0.957,
      0.989
    ],
    "worst_frame_build_time_millis": [
      6.626,
      3.815,
      3.987,
      2.496
    ],
    "90th_percentile_frame_build_time_millis": [
      1.8,
      1.588,
      1.325,
      1.491
    ],
    "99th_percentile_frame_build_time_millis": [
      3.165,
      3.455,
      2.055,
      2.346
    ],
    "average_frame_rasterizer_time_millis": [
      2.194,
      2.124,
      2.253,
      2.263
    ],
    "worst_frame_rasterizer_time_millis": [
      6.192,
      3.112,
      3.158,
      2.924
    ],
    "90th_percentile_frame_rasterizer_time_millis": [
      2.596,
      2.563,
      2.67,
      2.658
    ],
    "99th_percentile_frame_rasterizer_time_millis": [
      2.9,
      2.83,
      2.932,
      2.868
    ],
    "average_layer_cache_count": [
      3.0,
      3.0,
      3.0,
      3.0
    ],
    "90th_percentile_layer_cache_count": [
      3.0,
      3.0,
      3.0,
      3.0
    ],
    "99th_percentile_layer_cache_count": [
      3.0,
      3.0,
      3.0,
      3.0
    ],
    "worst_layer_cache_count": [
      3.0,
      3.0,
      3.0,
      3.0
    ],
    "average_layer_cache_memory": [
      4.6307373046875,
      4.6307373046875,
      4.6307373046875,
      4.6307373046875
    ],
    "90th_percentile_layer_cache_memory": [
      4.6307373046875,
      4.6307373046875,
      4.6307373046875,
      4.6307373046875
    ],
    "99th_percentile_layer_cache_memory": [
      4.6307373046875,
      4.6307373046875,
      4.6307373046875,
      4.6307373046875
    ],
    "worst_layer_cache_memory": [
      4.6307373046875,
      4.6307373046875,
      4.6307373046875,
      4.6307373046875
    ],
    "average_picture_cache_count": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "90th_percentile_picture_cache_count": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "99th_percentile_picture_cache_count": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "worst_picture_cache_count": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "average_picture_cache_memory": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "90th_percentile_picture_cache_memory": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "99th_percentile_picture_cache_memory": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "worst_picture_cache_memory": [
      0.0,
      0.0,
      0.0,
      0.0
    ],
    "new_gen_gc_count": [
      2.0,
      2.0,
      2.0,
      2.0
    ],
    "old_gen_gc_count": [
      0.0,
      0.0,
      0.0,
      0.0
    ]
  }
}

@flar
Copy link
Contributor

flar commented May 10, 2022

First, this appears to be modifying an existing benchmark. Once a benchmark is added, it should remain stable as its performance history is tracked. If you have new things to benchmark, a new benchmark should be created so that it doesn't interfere with existing metrics.

Thank you for reply.

For the this point, clipper_cache_perf__e2e_summary seems to be a new benchmark so that it doesn't interfere with existing metrics.

Please ignore that part of my comment. When I looked at it the other day all I saw was a few changes that updated a file in the macrobenchmarks area - which looked exactly like it was just modifying an existing benchmark.

But, I now see that this PR is about adding a new benchmark.

I think I was confused by the link in one of the emails taking me to just a single commit in the chain rather than showing me the entire set of code changes.

Copy link
Contributor

@flar flar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@flar
Copy link
Contributor

flar commented May 12, 2022

@keyonghan did you look over the CI files?

@wangying3426 wangying3426 merged commit b3d7a69 into flutter:master May 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request May 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 13, 2022
@wangying3426
Copy link
Contributor Author

flutter/engine#32899 depends on it, so merge it first. we can revert it later if there is any problem.

@flar
Copy link
Contributor

flar commented May 16, 2022

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 30, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants