First NDK test with Island: libs very large

I create all NDK libs for my Android apps with Android Studio for now.
Now i will try creating the libs with Island.

I created a test project with the “Static Library (Android NDK)” template and changed the executable type to “Library”.
After compiling in release mode (empty project, only base class from template) the resulting library file is more than 3 MB in size.

My largest Android Studio lib with hundreds of functions and a complete Lua interpreter inside has only 550 KB.

???

Probably depends on what other libraries you link in. It might also matter for how many separate architectures you build your library. That said, Island does link in some base stuff that a plain C library would not, such as Island RTL (to give you nice things such as Objects), and the GC.

I created the project from the template, therefore it contains references to Island, gc and rtl. And it seems the project doesn’t compile without this three lib’s.

Sad. If smaller lib’s not possible Island isn’t useful for most NDK programming imho.

But really, what’s 3MB in the great scene of things, today? Those are a base, one-time cost, they don’t “duplicate” as your own code grows.

3MB is at the moment 75% of the 4MB limit for instant apps.

FWIW the next beta will have vastly reduced executable sizes;
Debug x86 is now 1.57 MB
Release x86 is 1.24 MB

the release apk with just x86 in it is 523kb

Update:

APK: 1.95 MB (With arm64, arm, armv7, x86, x86_64, between 1 378 768 and 1 701 944 bytes)

2 Likes