Skip to content

Add benchmark for Mouse region (web)#59803

Merged
fluttergithubbot merged 12 commits intoflutter:masterfrom
dkwingsmt:mouse-region-grid-benchmark-web
Jun 19, 2020
Merged

Add benchmark for Mouse region (web)#59803
fluttergithubbot merged 12 commits intoflutter:masterfrom
dkwingsmt:mouse-region-grid-benchmark-web

Conversation

@dkwingsmt
Copy link
Contributor

@dkwingsmt dkwingsmt commented Jun 18, 2020

Description

This PR adds two benchmarks for web, testing its performance on handling a large number of mouse regions:

Related Issues

Tests

I added the following tests:

  • N/A

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.

@fluttergithubbot fluttergithubbot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Jun 18, 2020
@fluttergithubbot
Copy link
Contributor

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.

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

@fluttergithubbot fluttergithubbot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. labels Jun 19, 2020
Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

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

Thanks for contributing benchmarks!


final _Tester tester = _Tester();

// Use a non-trivial border to force Web to switch painter
Copy link
Contributor

Choose a reason for hiding this comment

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

Switch painter in what way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doesn't Web use a simpler painter (CSS?) for simple widgets, and canvas for more advanced ones? According to my test the performance only regresses when the box has a partial border.

}

class _Tester {
static const Duration hoverDuration = Duration(milliseconds: 20);
Copy link
Contributor

Choose a reason for hiding this comment

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

That's barely over 1 frame. Is that long enough? It looks like it will be jumping between the 4 corners way too quickly, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This duration is actually only used for the timeStamp of the event. The actual events are dispatched as fast as possible. The idea is to test the execution time the hit testing function.

@fluttergithubbot fluttergithubbot merged commit 65b1956 into flutter:master Jun 19, 2020
zljj0818 pushed a commit to zljj0818/flutter that referenced this pull request Jun 22, 2020
@liyuqian liyuqian added the c: performance Relates to speed or footprint issues (see "perf:" labels) label Jul 9, 2020
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: tests "flutter test", flutter_test, or one of our tests c: contributor-productivity Team-specific productivity, code health, technical debt. c: performance Relates to speed or footprint issues (see "perf:" labels) framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants