drift icon indicating copy to clipboard operation
drift copied to clipboard

huge increase in app size after adding moor_ffi

Open nailgilaziev opened this issue 4 years ago • 3 comments

iOS. Release mode. App size for simple ios app with one pub dependency(msgpack_dart) before adding moor_ffi: bundle: 51.5 Mb app on device: 51.7 Mb After adding moor_ffi and using example code: bundle: 220.9 Mb app on device: 222.4 Mb

[✓] Flutter (Channel master, v1.13.10-pre.65, on Mac OS X 10.15.2 19C57, locale en-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.5)

Is this size increasing behavior expected/normal?

nailgilaziev avatar Jan 19 '20 14:01 nailgilaziev

That is definitely not normal, moor_ffi on iOS shouldn't increase the app size by much (we don't have any external native dependency on iOS). On Android it can add ~3 MB when not using app bundles, but on iOS it's pretty much only the Dart code.

I didn't have size problems with moor_ffi on iOS in the past - can you check whether this also happens on stable?

simolus3 avatar Jan 19 '20 17:01 simolus3

if I remember correctly stable channel doesn't contain ffi

nailgilaziev avatar Jan 19 '20 17:01 nailgilaziev

I think the latest stable (v1.12.13+hotfix.5) uses Dart 2.7 and supports dart:ffi. I don't have access to a Mac at the moment, but I'll check the stable and develop channel of Flutter next week and try to reproduce this.

simolus3 avatar Jan 19 '20 19:01 simolus3