What does the --split-debug-info flag do when building a Flutter app?
The split-debug-info flag extracts debug symbols into a separate file, which can reduce the compiled Dart code size significantly.
Reduce app size, optimize rendering with Impeller, and profile frame performance
You can read this lesson publicly. Sign in to unlock exercises, quiz, and FX progress tracking.
Having trouble? AI is here to help
Ask context-aware questions about this lesson. Free plan: 5 questions/day. Upgrade to Premium for higher daily limits.
Use the AI button at the bottom of the screen
App size directly affects download speed, install rates, and user retention. A large app takes longer to download and uses more storage on the device, which can cause users to skip the install or uninstall it later. Flutter provides several tools and techniques for reducing your final binary size. The split-debug-info flag moves debug symbols into a separate file, which can reduce the compiled Dart code by up to 40 percent. Tree shaking automatically removes unused code and assets from the final build. Deferred loading lets you split your app into smaller pieces that are downloaded on demand instead of all at once. On the rendering side, Flutter now uses the Impeller rendering engine by default on iOS and Android API 29 and above. Impeller precompiles all shaders at build time, which eliminates the shader compilation jank that used to cause stuttering during the first run of animations. Understanding build modes is also important because debug builds include overhead for hot reload and source-level debugging that is not present in release builds. Always measure performance in profile mode, which uses release-level compilation but still allows DevTools profiling.
1// ── Reduce App Size ──23// 1. Build with split-debug-info to reduce Dart code size4// flutter build apk --split-debug-info=build/debug-info --obfuscate5// flutter build ipa --split-debug-info=build/debug-info --obfuscate67// 2. Analyze your app size breakdown8// flutter build apk --analyze-size9// flutter build appbundle --analyze-size10// This generates a JSON file you can load into DevTools1112// 3. Use deferred loading for large features13// import 'package:my_app/heavy_feature.dart' deferred as heavy;14//15// Future<void> loadFeature() async {16// await heavy.loadLibrary();17// heavy.showHeavyFeature();18// }1920// 4. Remove unused dependencies from pubspec.yaml21// flutter pub deps --no-dev | grep unused2223// ── Optimize Images ──24// Compress PNGs and JPEGs before adding to assets/25// Use WebP format for smaller file sizes26// Resize images to max display size, not original resolution2728// Example: Load images at specific cache dimensions29Image.asset(30'assets/photo.jpg',31cacheWidth: 300, // decode to smaller size in memory32cacheHeight: 300,33fit: BoxFit.cover,34)3536// ── Profile Rendering Performance ──3738// Always profile in profile mode, not debug mode39// flutter run --profile4041// Check frame rendering with Performance Overlay42MaterialApp(43showPerformanceOverlay: true, // shows GPU and UI thread bars44home: MyHomePage(),45)4647// ── Avoid Expensive Operations ──4849// BAD: Opacity widget triggers saveLayer (expensive)50Opacity(51opacity: 0.5,52child: Container(color: Colors.blue, width: 100, height: 100),53)5455// GOOD: Use a semi-transparent color directly56Container(57color: Colors.blue.withValues(alpha: 0.5),58width: 100,59height: 100,60)6162// BAD: AnimatedBuilder rebuilds child unnecessarily63AnimatedBuilder(64animation: _controller,65builder: (context, child) {66return Transform.rotate(67angle: _controller.value * 2 * 3.14159,68child: ExpensiveWidget(), // rebuilt every frame!69);70},71)7273// GOOD: Pass child to avoid rebuilding it74AnimatedBuilder(75animation: _controller,76builder: (context, child) {77return Transform.rotate(78angle: _controller.value * 2 * 3.14159,79child: child, // reused, not rebuilt80);81},82child: ExpensiveWidget(), // built once83)
Impeller is the default rendering engine in Flutter for iOS and Android API 29 and above. Unlike the older Skia-based renderer, Impeller precompiles all shaders at engine build time so they never need to compile at runtime. This eliminates the shader compilation jank that caused visible stuttering when users first encountered certain animations or visual effects. Impeller also leverages modern graphics APIs like Metal on iOS and Vulkan on Android to provide more predictable frame rendering times. On older Android devices that do not support Vulkan, Flutter automatically falls back to an OpenGL-based renderer. You do not need to make any code changes to benefit from Impeller because it is enabled by default.
Flutter has three build modes. Debug mode enables hot reload and detailed error messages but is slow and has a large binary size. Profile mode uses release-level compilation but keeps DevTools profiling enabled so you can measure real performance. Release mode is fully optimized for end users with no debugging overhead. Always measure performance in profile mode because debug mode is not representative of what users experience.
Treat app size and rendering performance as a release pipeline step:
Continuous measurement prevents slow creep in size and frame performance.
Flutter's legacy rendering engine, Skia, compiled GPU shaders just-in-time (JIT) when an animation or filter first appeared on screen. Compiling shaders during runtime caused noticeable frame drops called Shader Compilation Jank.
Impeller completely replaces Skia as the default mobile rendering engine:
Reduce app size, optimize rendering with Impeller, and profile frame performance. Forms collect user input, and validation ensures the input is safe and useful.
Think in architecture, reliability, and team-level maintainability.
Show validation messages early and clearly, near the field that needs correction.
Most app trust problems start when invalid or incomplete input reaches backend systems.
Validated input at UI and domain layers protects business logic from invalid assumptions.
As your app grows, keep UI, state, and data responsibilities separate so each part stays testable and easier to modify.
The split-debug-info flag extracts debug symbols into a separate file, which can reduce the compiled Dart code size significantly.
Impeller precompiles all shaders at build time so they do not need to compile during runtime, eliminating the stuttering that occurred with the older Skia renderer.
The Opacity widget calls saveLayer to create an offscreen buffer, which is expensive. Use AnimatedOpacity or apply a semi-transparent color directly instead.
Something seems incorrect, unclear, or missing? Let us know.
FlutterCraft editorial lessons are reviewed by experienced Flutter developers and updated to stay aligned with modern Flutter and Dart best practices.
Reference docs: Flutter Documentation, Dart Language Tour, and official package documentation where relevant.
Sign in to continue with exercises and quiz for this lesson.
Sign In to Continue