Javet icon indicating copy to clipboard operation
Javet copied to clipboard

Possibilities to reduce the native library size?

Open SomeGuy87 opened this issue 2 years ago • 1 comments

Hello there!

I'm currently working on an Android project that uses Javet 1.0.7 (due to the minApi requiring 21 support). This app needs to remain as small in size as possible - When looking into the resulting app, the biggest library by far is libjavet-v8android.v.1.0.7.so with around 43MB in the arm64-v8a libs folder.

I was wondering if there is something that could be done to reduce this size for an app that only requires very basic javascript execution (managing and manipulating variables without any fancy features). As is probably apparent I have no idea how the v8 library works specifically and if it's possible to shrink the native lib, compared to other libraries it just seems gigantic to me (WebRTC, Tensor etc. all are below 10MB in comparison).

I'm thinking about maybe an "essentials" variant or something similar, or maybe I'm already overlooking possibilities for this.

I'd appeciate any feedback on this!

SomeGuy87 avatar Aug 01 '23 12:08 SomeGuy87

This is a good point. There are plenty of folks working on building feature reduced V8 binaries. Some of them have made significant progress. You may take a try by creating your own build.

The official build has removed i18n. I think you might want to remove WebAssembly, inspector, debugging, ... etc. In general, I have no bandwidth supporting such legacy releases. Please feel free to help yourself.

Please let me know if you have any questions.

caoccao avatar Aug 01 '23 12:08 caoccao