// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_driver/flutter_driver.dart';
import 'package:macrobenchmarks/common.dart';
import 'util.dart';
void main() {
macroPerfTest(
'tessellation_perf_dynamic',
kPathTessellationRouteName,
pageDelay: const Duration(seconds: 1),
duration: const Duration(seconds: 10),
setupOps: (FlutterDriver driver) async {
final SerializableFinder animateButton =
find.byValueKey('animate_button');
await driver.tap(animateButton);
await Future<void>.delayed(const Duration(seconds: 1));
},
);
}
-
Matej Knopp authored
This adds a macrobenchmark representative of a real world application that uses SVG icons. The scenario of rasterizing complex paths that don't change over time does not seem to be covered by any other macrobenchmark and shows a significantly slower impeller performance compared to skia. It's actually bit problematic to measure this because on A15 the CPU load with impeller is high enough to trigger CPU frequency change. So in order to get consistent reading I had to add a spinning background thread that would keep the CPU at highest frequency. ```objc [NSThread detachNewThreadWithBlock:^{ while (true) { pthread_yield_np(); } }]; ``` ```bash flutter drive --profile --local-engine=ios_profile -t test_driver/run_app.dart --driver test_driver/path_tessellation_static_perf_test.dart ``` | average_frame_build_time_millis |Time| |--|--| | Impeller | 0.46686524822695047 | | Skia | 0.4625749999999999 | | Skia - No RasterCache | 0.47173750000000086| | average_frame_rasterizer_time_millis | Time | |--|--| | Impeller | 6.654328519855595 | | Skia - Raster Cache | 0.2534123711340209 * | | Skia - No RasterCache | 0.53424375 | * Adding the `GeometryPainter` seems to have triggered the complexity threshold for raster cache. <img alt="screenshot" width="320" src="https://github.com/flutter/flutter/assets/96958/7a2f9384-b512-477b-bffa-058d4d284a41"/>