realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.79k stars 575 forks source link

Investigate iOS framework file size #4095

Open nirinchev opened 2 years ago

nirinchev commented 2 years ago

While looking at an unrelated issue with @kneth, we noticed the file size of the iOS binary is surprisingly large. Here's a table of comparison of file sizes between js and .NET:

binary js .NET
ios-arm64_armv7 111 MB 60.5 MB
iosarm64_i386_x86_64simulator 98.1 MB 45 MB
androidarm64v8a 8.8 MB 8.3 MB
androidarmeabiv7a 6 MB 5.7 MB
androidarmeabiv7a 9.6 MB 9 MB

What's noticeable is that while the android binaries are fairly similar in size, the iOS ones are almost twice as large as the .NET binaries. It likely points to an incorrect build configuration for iOS.

kneth commented 2 years ago

It is related to https://github.com/realm/realm-js/issues/3652 and maybe https://github.com/realm/realm-js/issues/3637

kraenhansen commented 5 months ago

These are updated numbers for the prebuilds produced in #6650:

binary js
ios-arm64 19 MB
ios-arm64_i386_x86_64-simulator 42 MB
ios-arm64_x86_64-maccatalyst 42 MB

I'm unsure how to reproduce the android measurement as I can't seem produce a release binary with the debug symbols stripped.

nirinchev commented 5 months ago

Are those numbers in release or debug builds? Because they still seem a bit large. For comparison, here's what we have on .NET:

binary .NET
ios-arm64 7.4 MB
ios-arm64_x86_64-simulator 15.5 MB
ios-arm64_x86_64-maccatalyst 16 MB