flutter_performance_testing
Performance testing utilities and benchmarks for Flutter applications. This package provides comprehensive tools for measuring and analyzing the performance of your Flutter apps across all supported platforms.
Features
- ๐ Cross-Platform Support: iOS, Android, Web, Windows, macOS, Linux
- ๐ WASM Compatible: Full support for WebAssembly compilation
- ๐ Performance Metrics: Frame rate, memory usage, CPU utilization
- โก Benchmark Tools: Widget rendering, animation performance, startup time
- ๐ Profiling: Detailed performance analysis and reporting
- ๐ฑ Real-time Monitoring: Live performance tracking during development
- ๐งช Testing Utilities: Performance testing for CI/CD pipelines
Getting Started
Installation
Add this to your package's pubspec.yaml file:
dependencies:
flutter_performance_testing: ^0.0.1
Basic Usage
import 'package:flutter_performance_testing/flutter_performance_testing.dart';
// Measure widget build performance
final stopwatch = Stopwatch()..start();
// Your widget building code here
stopwatch.stop();
final performance = PerformanceMetrics(
buildTime: stopwatch.elapsedMicroseconds,
memoryUsage: getCurrentMemoryUsage(),
frameRate: getCurrentFrameRate(),
);
print('Widget built in ${performance.buildTime} microseconds');
Platform Support
| Platform | Status | Notes |
|---|---|---|
| iOS | โ | Full support |
| Android | โ | Full support |
| Web | โ | WASM compatible |
| Windows | โ | Full support |
| macOS | โ | Full support |
| Linux | โ | Full support |
Performance Metrics
The package provides comprehensive performance metrics:
- Build Time: Widget rendering performance
- Memory Usage: RAM consumption tracking
- Frame Rate: FPS monitoring and analysis
- CPU Usage: Processor utilization
- Startup Time: App initialization performance
- Animation Performance: Smoothness and timing
Advanced Features
Benchmark Suite
import 'package:flutter_performance_testing/benchmark.dart';
final benchmark = BenchmarkSuite();
benchmark.addTest('widget_build', () {
// Your performance test here
});
final results = await benchmark.run();
Memory Profiling
import 'package:flutter_performance_testing/memory_profiler.dart';
final profiler = MemoryProfiler();
profiler.startTracking();
// Your code here
final report = profiler.generateReport();
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- ๐ง Email:
your-email@example.com - ๐ Issues: GitHub Issues
- ๐ Documentation: API Reference
Changelog
See CHANGELOG.md for a list of changes and version history.