• Yazeed Al-Khalaf's avatar
    :black_nib: Spell Check All `.md` Files Related to Flutter :blue_heart: (#61564) · d41b1fbb
    Yazeed Al-Khalaf authored
    * :bug: Fix Spelling Issues in Main README.md
    
    * :bug: Fix spelling issues in dev README.md
    
    * :bug: Fix spelling issues in complex_layout README.md
    
    * :bug: Fix spelling issues in macrobenchmarks README.md
    
    * :bug: Fix spelling issues in platform_views_layout README.md
    
    * :bug: Fix spelling issues in test_Apps/stocks README.md
    
    * :bug: Fix spelling issues in bots README.md
    
    * :black_nib: Spell Check dev/ci README.md
    
    * :black_nib: Spell Check dev/ci/docker_linux README.md
    
    * :black_nib: Spell Check dev/devicelab README.md
    
    * :black_nib: Spell Check dev/docs README.md
    
    * :black_nib: Spell Check dev/snippets README.md
    
    * :black_nib: Spell Check dev/snippets/config/templates README.md
    
    * :black_nib: Spell Check dev/tools/gen_keycodes README.md
    
    * :black_nib: Spell Check dev/tools/vitool README.md
    
    * :black_nib: Spell Check examples/catalog README.md
    
    * :black_nib: Spell Check examples/flutter_view README.md
    
    * :black_nib: Spell Check examples/image_list README.md
    
    * :black_nib: Spell Check examples/layers README.md
    
    * :black_nib: Spell Check examples/platform_channel README.md
    
    * :black_nib: Spell Check examples/platform_channel_swift README.md
    
    * :black_nib: Spell Check examples/platform_view README.md
    
    * :black_nib: Spell Check packages/_flutter_web_build_script README.md
    
    * :black_nib: Spell Check packages/flutter_localizations README.md
    
    * :black_nib: Spell Check packages/flutter_tools README.md
    
    * :black_nib: Spell Check CODE_OF_CONDUCT.md
    
    * :black_nib: Spell Check dev/integration_test/android_splash_screens/splash_Screen_load_rotate README.md
    
    * :black_nib: Spell Check dev/integration_test/android_views README.md
    
    * :black_nib: Spell Check dev/integration_tests/flutter_driver_screenshot_test README.md
    
    * :black_nib: Spell Check dev/integration_tests/flutter_gallery README.md
    
    * :black_nib: Spell Check dev/integration_tests/gradle_deprecated_settings README.md
    
    * :black_nib: Spell Check dev/integration_tests/ios_add2app_life_cycle README.md
    
    * :black_nib: Spell Check dev/integration_tests/ios_host_app README.md
    
    * :black_nib: Spell Check dev/integration_tests/ios_platform_view_tests README.md
    
    * :black_nib: Spell Check dev/automated_tests/flutter_test README.md
    
    * :black_nib: Spell Check .github/PULL_REQUEST_TEMPLATE.md
    
    * :black_nib: Spell Check .hithub/ISSUE_TEMPLATE/ACTIVATION.md
    
    * :black_nib: Spell Check .github/ISSUE_TEMPLATE/BUG.md
    
    * :black_nib: Spell Check .github/ISSUE_TEMPLATE/feature_request.md
    
    * :black_nib: Spell Check .github/ISSUE_TEMPLATE/performance_others.md
    
    * :black_nib: Spell Check .github/ISSUE_TEMPLATE/performance_speed.md
    
    * :black_nib: Spell Check packages/flutter_tools/doc/daemon.md
    
    * :black_nib: Spell Check packages/flutter_tools/fuchsia_enrtypoint_shim/README.md
    
    * :black_nib: Minimize line to 80 columns
    
    * :black_nib: Minimize line to 80 columns
    
    * :black_nib: Fix Typo
    
    * :black_nib: Chnaged numbers to 1 for testing purposes
    
    * :black_nib: Changed numbers to 1 for testing purposes
    
    * :x: Remove 'a' which is a typo
    
    * :black_nib: Change a sentence to be better
    
    * :black_nib: Remove 'a' which is a typo
    
    * :black_nib: Fix small issue
    
    * :black_nib: Fix small typo
    
    * :black_nib: Fix some typos
    
    * :x: Remove trailing space
    
    * :x: Remove trailing space
    
    * :bug: Fix small typo
    
    * :black_nib: Fix Typo
    
    * :bug: Fix small bug
    d41b1fbb
Name
Last commit
Last update
..
android Loading commit data...
assets Loading commit data...
ios Loading commit data...
lib Loading commit data...
macos Loading commit data...
test Loading commit data...
test_driver Loading commit data...
test_memory Loading commit data...
web Loading commit data...
.gitignore Loading commit data...
README.md Loading commit data...
pubspec.yaml Loading commit data...

Macrobenchmarks

Performance benchmarks use either flutter drive or the web benchmark harness.

Mobile benchmarks

Cull opacity benchmark

To run the cull opacity benchmark on a device:

flutter drive --profile test_driver/cull_opacity_perf.dart

Results should be in the file build/cull_opacity_perf.timeline_summary.json.

More detailed logs should be in build/cull_opacity_perf.timeline.json.

Cubic bezier benchmark

To run the cubic-bezier benchmark on a device:

flutter drive --profile test_driver/cubic_bezier_perf.dart

Results should be in the file build/cubic_bezier_perf.timeline_summary.json.

More detailed logs should be in build/cubic_bezier_perf.timeline.json.

Backdrop filter benchmark

To run the backdrop filter benchmark on a device: To run a mobile benchmark on a device:

flutter drive --profile -t test_driver/run_app.dart --driver test_driver/[test_name]_test.dart

Results should be in the file build/[test_name].timeline_summary.json.

More detailed logs should be in build/[test_name].timeline.json.

The key [test_name] can be:

  • animated_placeholder_perf
  • backdrop_filter_perf
  • cull_opacity_perf
  • fading_child_animation_perf
  • imagefiltered_transform_animation_perf
  • multi_widget_construction_perf
  • picture_cache_perf
  • post_backdrop_filter_perf
  • simple_animation_perf
  • textfield_perf
  • cubic_bezier_perf

Web benchmarks

Web benchmarks are compiled from the same entry point in lib/web_benchmarks.dart.

How to write a web benchmark

Create a new file for your benchmark under lib/src/web. See bench_draw_rect.dart as an example.

Choose one of the two benchmark types:

  • A "raw benchmark" records performance metrics from direct interactions with dart:ui with no framework. This kind of benchmark is good for benchmarking low-level engine primitives, such as layer, picture, and semantics performance.
  • A "widget benchmark" records performance metrics using a widget. This kind of benchmark is good for measuring the performance of widgets, often together with engine work that widget-under-test incurs.
  • A "widget build benchmark" records the cost of building a widget from nothing. This is different from the "widget benchmark" because typically the latter only performs incremental UI updates, such as an animation. In contrast, this benchmark pumps an empty frame to clear all previously built widgets and rebuilds them from scratch.

For a raw benchmark extend RawRecorder (tip: you can start by copying bench_draw_rect.dart).

For a widget benchmark extend WidgetRecorder (tip: you can start by copying bench_simple_lazy_text_scroll.dart).

For a widget build benchmark extend WidgetBuildRecorder (tip: you can start by copying bench_build_material_checkbox.dart).

Pick a unique benchmark name and class name and add it to the benchmarks list in lib/web_benchmarks.dart.

How to run a web benchmark

Web benchmarks can be run using flutter run in debug, profile, and release modes, using either the HTML or the CanvasKit rendering backend. Note, however, that running in debug mode will result in worse numbers. Profile mode is useful for profiling in Chrome DevTools because the numbers are close to release mode and the profile contains unobfuscated names.

Example:

cd dev/benchmarks/macrobenchmarks

# Runs in profile mode using the HTML renderer
flutter run --profile -d web-server lib/web_benchmarks.dart

# Runs in profile mode using the CanvasKit renderer
flutter run --dart-define=FLUTTER_WEB_USE_SKIA=true --profile -d web-server lib/web_benchmarks.dart

You can also run all benchmarks exactly as the devicelab runs them:

cd dev/devicelab

# Runs using the HTML renderer
../../bin/cache/dart-sdk/bin/dart bin/run.dart -t bin/tasks/web_benchmarks_html.dart

# Runs using the CanvasKit renderer
../../bin/cache/dart-sdk/bin/dart bin/run.dart -t bin/tasks/web_benchmarks_canvaskit.dart