fix: Slow encode & save image file in only patch mode on iOS
App ID: 92d20fb5-52f6-40c3-beb8-7cb4cd31e3b2
Description
The encodeJpgFile function (lib: image-4.1.3) encodes an image to a JPG file and saves it. In Shorebird release mode, it takes about 100-200ms, but in Shorebird patch mode, this function takes 5-7 seconds to run. Has anyone found a solution for this case?
Cmd: shorebird release ios --flutter-version=3.24.5 --no-confirm --artifact apk -t lib/main.dart --flavor dev --dart-define-from-file=config/dev.json --export-options-plist=ios/export_options_dev.plist shorebird patch ios --release-version=1.0.0+22 --no-confirm -t lib/main.dart --flavor dev --dart-define-from-file=config/dev.json
Expected Behavior
run encodeJpgFile in patch mode same release mode
Additional Context
Shorebird 1.6.36 • [email protected]:shorebirdtech/shorebird.git Flutter 3.29.3 • revision 7c1c25e48e6dd849c3264588346aa63652d5e426 Engine • revision 59f6f7280ef9296791857b608b93d3a2c020d477
Logs: /Users/xxx/Library/Application Support/shorebird/logs Android Toolchain • Android Studio: /Applications/Android Studio.app/Contents • Android SDK: /Users/xxx/Library/Android/sdk • ADB: /Users/xxx/Library/Android/sdk/platform-tools/adb • JAVA_HOME: /Applications/Android Studio.app/Contents/jbr/Contents/Home • JAVA_EXECUTABLE: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • JAVA_VERSION: openjdk version "17.0.6" 2023-01-17 OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231) OpenJDK 64-Bit Server VM (build 17.0.6+0-17.0.6b829.9-10027231, mixed mode)
• Gradle: 8.5
This is due to https://docs.shorebird.dev/code-push/performance/. This type of failure is uncommon, but does happen. It happens when the Dart compiler decides to "optimize" a part of the patch in a different way than it did in the base and causes a ton of the patch to "unlink". If you're able to share your patch-debug.zip we're happy to take a look further!
@eseidel Is the patch-debug.zip file safe to share publicly or should I send it to you via email?
Email is best. It contains class and function names from your source code which some people don't want to share. Thanks!