web_benchmarks
4.1.3, released 10 days ago by flutter.dev
A benchmark harness for performance-testing Flutter web apps in Chrome.
What it does
Provides a client and server harness to performance-test Flutter web applications inside Chrome. It automates running benchmarks, extracting performance traces, and analyzing or comparing results.
AI-written summary of version 4.1.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to performance-test Flutter web applications in Chrome
- You want to compute deltas or averages between multiple benchmark runs
Skip it when
- You are testing mobile or desktop apps rather than Flutter web
- You want to run benchmarks in browsers other than Chrome
Strengths
- Automates extracting performance traces and metrics from Chrome
- Supports analyzing and comparing benchmark results with built-in delta and average computations
Weaknesses
- Currently only supports running benchmarks in Chrome
- Requires setting up both a client and a server harness
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 9
Requires setting up a client benchmark code piece and a server to serve the app's code, assets, and communicate with the browser.
import 'dart:convert';
import 'dart:io';
import 'package:web_benchmarks/analysis.dart';
void main() {
final BenchmarkResults baselineResults = BenchmarkResults.parse({});
final BenchmarkResults testResults1 = BenchmarkResults.parse({});
final BenchmarkResults delta = computeDelta(baselineResults, testResults1);
stdout.writeln(delta.toJson());
}Alternatives
Packages that do the same job and could replace web_benchmarks.
- benchmark_harness
A Dart benchmark harness for measuring code performance
79Compare - fluttersdk_dusk
Flutter E2E test driver for LLM agents and CLI via VM Service extensions without a test harness.
77Compare
Works with
Packages commonly used together with web_benchmarks: ones it builds on, ones built on it, and its own family.
- webweb_benchmarks depends on itLightweight bindings for browser APIs via JS interop
- shelfweb_benchmarks depends on itComposable web server middleware for Dart
- processweb_benchmarks depends on itPluggable, mockable process invocation abstraction for Dart.
- shelf_staticweb_benchmarks depends on itServe static files over HTTP with the shelf package
- loggingweb_benchmarks depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- webkit_inspection_protocolweb_benchmarks depends on itA client for the Chrome DevTools Protocol to talk to debuggers.