Add benchmark for Mouse region (web)#59803
Conversation
|
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. |
yjbanov
left a comment
There was a problem hiding this comment.
Thanks for contributing benchmarks!
|
|
||
| final _Tester tester = _Tester(); | ||
|
|
||
| // Use a non-trivial border to force Web to switch painter |
There was a problem hiding this comment.
Switch painter in what way?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Description
This PR adds two benchmarks for web, testing its performance on handling a large number of mouse regions:
bench_mouse_region_grid_scroll, where a large number of non-trivial mouse regions are rendered and scrolled (Poor performance when subscribing to MouseRegion events #41194)bench_mouse_region_grid_hover, where heavily nested mouse regions are rendered and hovered.Related Issues
Tests
I added the following tests:
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.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.