Commit Graph

42 Commits

Author SHA1 Message Date
Yegor
07772a3d23
[framework,web] add FlutterTimeline and semantics benchmarks that use it (#128366)
## FlutterTimeline

Add a new class `FlutterTimeline` that's a drop-in replacement for `Timeline` from `dart:developer`. In addition to forwarding invocations of `startSync`, `finishSync`, `timeSync`, and `instantSync` to `dart:developer`, provides the following extra methods that make is easy to collect timings for code blocks on a frame-by-frame basis:

* `debugCollect()` - aggregates timings since the last reset, or since the app launched.
* `debugReset()` - forgets all data collected since the previous reset, or since the app launched. This allows clearing data from previous frames so timings can be attributed to the current frame.
* `now` - this was enhanced so that it works on the web by calling `window.performance.now` (in `Timeline` this is a noop in Dart web compilers).
* `collectionEnabled` - a field that controls whether `FlutterTimeline` stores timings in memory. By default this is disabled to avoid unexpected overhead (although the class is designed for minimal and predictable overhead). Specific benchmarks can enable collection to report to Skia Perf.

## Semantics benchmarks

Add `BenchMaterial3Semantics` that benchmarks the cost of semantics when constructing a screen full of Material 3 widgets from nothing. It is expected that semantics will have non-trivial cost in this case, but we should strive to keep it much lower than the rendering cost. This is the case already. This benchmark shows that the cost of semantics is <10%.

Add `BenchMaterial3ScrollSemantics` that benchmarks the cost of scrolling a previously constructed screen full of Material 3 widgets. The expectation should be that semantics will have trivial cost, since we're just shifting some widgets around. As of today, the numbers are not great, with semantics taking >50% of frame time, which is what prompted this PR in the first place. As we optimize this, we want to see this number improve.
2023-06-21 21:37:02 +00:00
Michael Goderbauer
48bb12dfbe
Make Element tree root generic (#123352)
Make Element tree root generic
2023-03-27 20:31:49 +00:00
Ian Hickson
6205c110d6
Remove "note that" in our documentation (as per style guide) (#120842)
* lerp documentation

* Remove Note, Note That from repo

* Improve BorderSide documentation.

* apply review comments
2023-02-17 22:27:33 +00:00
Michael Goderbauer
b0f1714b7b
Make Flex,Row,Column const for real (#119673)
* Make Flex,Row,Column const for real

* dart fix --apply

* fix snippets

* fix integration test

* add comment
2023-02-02 19:33:57 +00:00
Andrew Kolos
fd76ef0f26
Reland "Add API for discovering assets" (#119277)
* add asset manifest bin loading and asset manifest api

* use new api for image resolution

* remove upfront smc data casting

* fix typecasting issue

* remove unused import

* fix tests

* lints

* lints

* fix import

* revert image resolution changes

* Update image_resolution_test.dart

* Update decode_and_parse_asset_manifest.dart

* make targetDevicePixelRatio optional

* Update packages/flutter/lib/src/services/asset_manifest.dart

Co-authored-by: Jonah Williams <jonahwilliams@google.com>

* Update packages/flutter/lib/src/services/asset_manifest.dart

Co-authored-by: Jonah Williams <jonahwilliams@google.com>

* fix immutable not being imported

* return List in AssetManifest methods, fix annotation import

* simplify onError callback

* make AssetManifest methods abstract instead of throwing UnimplementedError

* simplify AssetVariant.key docstring

* tweak _AssetManifestBin docstring

* make AssetManifest and AssetVariant doc strings more specific

* use List.of instead of List.from for type-safety

* adjust import

* change _AssetManifestBin comment from doc comment to normal comment

* revert to callback function for onError in loadStructuredBinaryData

* add more to the docstring of AssetManifest.listAssets and AssetVariant.key

* add tests for CachingAssetBundle caching behavior

* add simple test to ensure loadStructuredBinaryData correctly calls load

* Update asset_manifest.dart

* update docstring for AssetManifest.getAssetVariants

* rename getAssetVariants, have it include main asset

* rename isMainAsset field of AssetMetadata to main

* (slightly) shorten name of describeAssetAndVariants

* rename describeAssetVariants back to getAssetVariants

* add tests for TestAssetBundle

* nits

* fix typo in docstring

* remove no longer necessary non-null asserts

* update gallery and google_fonts versions

---------

Co-authored-by: Jonah Williams <jonahwilliams@google.com>
2023-02-02 15:17:15 +00:00
Christopher Fujino
a04ab7129b
Revert "Add API for discovering assets (#118410)" (#119273)
This reverts commit 2b8f2d0504.
2023-01-26 20:01:12 +00:00
Andrew Kolos
2b8f2d0504
Add API for discovering assets (#118410)
* add asset manifest bin loading and asset manifest api

* use new api for image resolution

* remove upfront smc data casting

* fix typecasting issue

* remove unused import

* fix tests

* lints

* lints

* fix import

* revert image resolution changes

* Update image_resolution_test.dart

* Update decode_and_parse_asset_manifest.dart

* make targetDevicePixelRatio optional

* Update packages/flutter/lib/src/services/asset_manifest.dart

Co-authored-by: Jonah Williams <jonahwilliams@google.com>

* Update packages/flutter/lib/src/services/asset_manifest.dart

Co-authored-by: Jonah Williams <jonahwilliams@google.com>

* fix immutable not being imported

* return List in AssetManifest methods, fix annotation import

* simplify onError callback

* make AssetManifest methods abstract instead of throwing UnimplementedError

* simplify AssetVariant.key docstring

* tweak _AssetManifestBin docstring

* make AssetManifest and AssetVariant doc strings more specific

* use List.of instead of List.from for type-safety

* adjust import

* change _AssetManifestBin comment from doc comment to normal comment

* revert to callback function for onError in loadStructuredBinaryData

* add more to the docstring of AssetManifest.listAssets and AssetVariant.key

* add tests for CachingAssetBundle caching behavior

* add simple test to ensure loadStructuredBinaryData correctly calls load

* Update asset_manifest.dart

* update docstring for AssetManifest.getAssetVariants

* rename getAssetVariants, have it include main asset

* rename isMainAsset field of AssetMetadata to main

* (slightly) shorten name of describeAssetAndVariants

* rename describeAssetVariants back to getAssetVariants

* add tests for TestAssetBundle

* nits

* fix typo in docstring

* remove no longer necessary non-null asserts

Co-authored-by: Jonah Williams <jonahwilliams@google.com>
2023-01-26 19:05:00 +00:00
Casey Hillers
7673108d7e
Revert "Speed up first asset load by encoding asset manifest in binary rather than JSON (#113637)" (#116662)
This reverts commit 56cad89b1e.
2022-12-07 17:29:05 +00:00
Andrew Kolos
56cad89b1e
Speed up first asset load by encoding asset manifest in binary rather than JSON (#113637) 2022-12-05 10:39:10 -08:00
Andrew Kolos
eec8d9d9cc
Add asset manifest parsing benchmark (#112836) 2022-10-07 13:39:35 +00:00
Jenn Magder
1bdba68d16
Force benchmark app to portrait (#112502) 2022-09-27 23:51:17 +00:00
Pierre-Louis
0c2f7bc2a2
Remove errant double spaces (#110758) 2022-09-02 04:00:58 +00:00
Michael Goderbauer
10a7c9ba22
Unify analysis options (#108462) 2022-07-28 09:07:49 -07:00
gaaclarke
d88212c89c
added microbenchmark for loading assets (#105982) 2022-06-16 18:16:07 +00:00
gaaclarke
64a0c19652
switched to a double variant of clamp to avoid boxing (#103559) 2022-05-18 13:26:08 -07:00
Jonah Williams
c1b909e3fc
add image load benchmark (#103459) 2022-05-10 22:49:08 -07:00
Alexandre Ardhuin
07f1c20474
add missing trailing commas in list/set/map literals (#102585) 2022-04-27 09:15:35 +02:00
gaaclarke
1ac368280f
Increased StandardMethodCodec's WriteBuffer start capacity (#101860)
* Added standard method codec benchmark

* increased writebuffer start size

* added const
2022-04-20 14:35:34 -07:00
gaaclarke
fd73f2730c
made ascii string encoding faster (#101777) 2022-04-12 19:54:11 -07:00
gaaclarke
e6f3022890
Adds StandardMessageCodec benchmark (#101767) 2022-04-12 16:34:10 -07:00
gaaclarke
a7790d8e3a
Added a microbenchmark for Timeline events. (#98763) 2022-02-22 13:42:50 -08:00
Ian Hickson
ab89ce285f
Clean up the bindings APIs. (#89451) 2022-02-03 14:55:15 -08:00
Ian Hickson
61a0add286
Enable avoid_redundant_argument_values lint (#91409) (#91462) 2021-10-08 09:25:14 -07:00
Zachary Anderson
b9d2177da0
Revert "Enable avoid_redundant_argument_values lint (#91409)" (#91461)
This reverts commit 5fd259be24.
2021-10-07 21:11:07 -07:00
Ian Hickson
5fd259be24
Enable avoid_redundant_argument_values lint (#91409) 2021-10-07 20:13:02 -07:00
Ren You
3dea9f0251
Revert "Clean up the bindings APIs (#86438)" (#86484)
This reverts commit d056500bfe.
2021-07-15 09:29:16 -07:00
Ian Hickson
d056500bfe
Clean up the bindings APIs (#86438) 2021-07-14 14:41:24 -07:00
Zachary Anderson
7f741e9181
Revert "Clean up the bindings APIs (#86388)" (#86404)
This reverts commit 31de052e3f.
2021-07-13 21:32:29 -07:00
Ian Hickson
31de052e3f
Clean up the bindings APIs (#86388) 2021-07-13 18:31:11 -07:00
Ian Hickson
c800b9c3e4
Revert "Clean up the bindings APIs (#83843)" (#86386)
This reverts commit e2490f2906.
2021-07-13 15:47:40 -07:00
Ian Hickson
e2490f2906
Clean up the bindings APIs (#83843) 2021-07-13 12:41:03 -07:00
Abhishek Ghaskata
d25a5c376d
Migrate microbrenchmarks to null safety (#83619) 2021-06-02 10:59:03 -07:00
Jason Simmons
992dba0c9a
Wait for frame rendering to stabilize before running the all_elements_bench benchmark (#81086) 2021-04-23 20:29:03 -07:00
knaeckeKami
d60cc08877
Add removeListenerWhileNotifying benchmark for ChangeNotifier (#78161) 2021-04-02 12:04:04 -07:00
Michael Goderbauer
8364140e51
Clean-up ignores that are not ignoring anything (dev/ edition) (#78490) 2021-03-18 11:06:03 -07:00
Christopher Fujino
97c1dedef9
Revert "Add removeListenerWhileNotifying benchmark for ChangeNotifier (#71986)" (#74450)
This reverts commit 831ee22b06.
2021-01-21 15:56:38 -08:00
Romain Rastel
831ee22b06
Add removeListenerWhileNotifying benchmark for ChangeNotifier (#71986) 2021-01-20 10:29:03 -08:00
Kate Lovett
f4a0511e8b
Re-land 'Default Keyboard ScrollActions with PrimaryScrollController' (#70893) 2020-11-19 17:48:04 -08:00
Dan Field
12f54e17f4
reland List queue search optimization (#68214)
* Revert "Revert "Improve performance of collectAllElements (#68065)" (#68207)"

This reverts commit 46ff57d6f1.

* use fewer elements for benchmark
2020-10-15 13:46:50 -07:00
Jonah Williams
46ff57d6f1
Revert "Improve performance of collectAllElements (#68065)" (#68207)
This reverts commit 8ba5732c4c.
2020-10-15 08:04:59 -07:00
Dan Field
8ba5732c4c
Improve performance of collectAllElements (#68065) 2020-10-14 21:32:04 -07:00
Remi Rousselet
2b25e29192
add benchmark for ChangeNotifier.notifyListeners (#62715) 2020-08-14 17:06:03 -07:00