Skip to content

Add ShaderMask benchmark case#100957

Closed
JsouLiang wants to merge 1 commit intoflutter:masterfrom
JsouLiang:sharder-mask-benchmark-case
Closed

Add ShaderMask benchmark case#100957
JsouLiang wants to merge 1 commit intoflutter:masterfrom
JsouLiang:sharder-mask-benchmark-case

Conversation

@JsouLiang
Copy link
Contributor

@JsouLiang JsouLiang commented Mar 29, 2022

Add ShaderMask test case for this PR: flutter/engine#32027
cc @flar

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@flutter-dashboard flutter-dashboard bot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Mar 29, 2022
@flar
Copy link
Contributor

flar commented Mar 31, 2022

I'm sorry I didn't notice that there were 2 PRs from 2 different authors for this same thing, but #100127 already landed so is this PR now a duplicate?

@wangying3426
Copy link
Contributor

I'm sorry I didn't notice that there were 2 PRs from 2 different authors for this same thing, but #100127 already landed so is this PR now a duplicate?

(⊙o⊙)… @JsouLiang and @wangying3426 work on the same team.
This test case is added to demonstrates that the saveLayer is need for cached child layer.

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.

Mostly questions to verify what I'm seeing.

android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see any reason for this flag to be set. These benchmarks aren't exporting any services. Was there a reason this got set here?

const SizedBox(height: 10),
buildShaderMaskWithBlendMode(BlendMode.dst, 'BlendMode.dst'),
const SizedBox(height: 10),
buildShaderMaskWithBlendMode(BlendMode.src, 'BlendMode.src'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Are all of these items visible on our default test device which is a Moto G4?

Copy link
Contributor

Choose a reason for hiding this comment

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

I just fetched this PR and ran this on my G4 and the dst is only partially visible some of the time. The src example never appears.

@flar
Copy link
Contributor

flar commented Apr 14, 2022

I'm sorry I didn't notice that there were 2 PRs from 2 different authors for this same thing, but #100127 already landed so is this PR now a duplicate?

(⊙o⊙)… @JsouLiang and @wangying3426 work on the same team. This test case is added to demonstrates that the saveLayer is need for cached child layer.

This is a benchmark. Nobody ever sees what it looks like as it is run in an anonymous lab. If this is testing that the right output is generated then this should not be a benchmark, it should be a golden test.

I think I see what is being added here now. Unfortunately, this raises a few issues which I'll address in a new comment.

@flutter-dashboard
Copy link

This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@flar
Copy link
Contributor

flar commented May 4, 2022

This looks like it is modifying an existing benchmark, but that is usually not a practice we encourage because it will disrupt the tracked history of the existing benchmark. We record the performance of all benchmarks over time so we can look for trends.

One reason to modify a benchmark is if we've made breaking changes and it needs to be updated to match the new APIs. That doesn't apply here.

Another reason to modify a benchmark is if it isn't actually exercising the issues that we originally wanted to address (in other words, the execution of the benchmark misses its mark). I don't think that is the case here, but let me know if this applies.

It looks like the existing benchmark was likely measuring something that we want to keep tracking, so it didn't really warrant any updates.

The new code looks like it is testing more conditions beyond the original benchmark, so it will both break the trends we have recorded for the previous version as well as now have 1 benchmark measuring the performance of a couple of cases. If so, then the different conditions warrant being measured in their own benchmarks so that we don't miss regressions when one of the test cases gets faster while the other gets slower - that could hide performance changes that we want to make visible.

I would like to see a better description of what this benchmark was measuring before these changes and what the new changes are measuring and how they differ from or complement each other.

@JsouLiang JsouLiang closed this May 6, 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.

3 participants