As requested, a comprehensive benchmark suite was created to measure the overhead and performance profile of flutter_screenutil_plus, standard flutter_screenutil, and pure Flutter code.
- Microbenchmarks: High frequency loops measuring the isolated Dart overhead of breakpoint resolution (
DeviceType, constraints computation) and mathematical scaling extensions (.w,.h,.sp, etc.). - Integration Benchmarks: Driver-powered timeline tests measuring the widget-tree layout bounds and frame drop percentages of three identical applications driven by different scale providers (
flutter_screenutil,flutter_screenutil_plus, and nativeMediaQuery).
This table demonstrates the raw CPU overhead in large layout cascades.
| Microbenchmark | Iterations | ScreenUtil Standard | ScreenUtilPlus | Improvement |
|---|---|---|---|---|
| Scaling Computation | 100K | 6922 us | 6311 us | 8.8% |
| Breakpoint Resolution | 1K | N/A (Standard lacks API) | 45.09 us | N/A |
This table demonstrates the Flutter rendering engine's ability to rasterize deep trees, lists, and perform bulk layout rebuilds when orientation changes (lower is better).
| Framework | Deep Tree Build (ms) | Scrolling Build (ms) | Orientation Rebuild (ms) |
|---|---|---|---|
| Standard Flutter | 1 | 227 | 191 |
| flutter_screenutil | 1 | 172 | 162 |
| flutter_screenutil_plus | 1 | 147 | 56 |
Note: All benchmarks are accessible via
dart run tool/run_benchmarks.dartand are perfectly suited for CI automated pipelines. Ensure that an iOS/Android simulator/device is attached, or run via-d macosas CI commands normally do.