Skip to content

size increase of core116 #4463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
r10s opened this issue Jun 8, 2023 · 8 comments
Closed

size increase of core116 #4463

r10s opened this issue Jun 8, 2023 · 8 comments

Comments

@r10s
Copy link
Contributor

r10s commented Jun 8, 2023

core116 is significantly larger than core112.8 - when building the new android 1.37, we got the following apk sizes (4 arch, all compressed):

android1.36.5 using core112.8:         56.3 mb
android1.37   using core116:           67.9 mb  ->  +11.6 mb compared to android1.36.5

android UI code or dependency itself did not grew significantly (first line shows is compiling new UI with old core) - but compiling 1.37 with --disable jsonrpc makes a difference:

android1.37, core112.8:                56.4 mb
android1.37, core116 without jsonrpc:  61.1 mb

part of the size increase is already detected by @link2xt already as "brotli". compiling with disabling unused brotli features as of #4461 , we get down 5.5 mb:

android1.37, #4461:                    62.4 mb  ->  +6.1 mb compared to android1.36.5
android1.37, #4461 without jsonrpc:    60.6 mb

idk, why the size decrease with --disable jsonrpc is less when using #4461 instead of core112.8.

i double checked that these sizes are not related to android UI code by compiling without jsonrpc with and without throwing out all jsonrpc depencies added at deltachat/deltachat-android#2479

maybe the size increase of then 6.1 mb is acceptable now, esp. as it maybe hard to get to the cause.

@adbenitez
Copy link
Collaborator

@r10s maybe interesting: DeltaLab release from 2 days ago has only + ~4MB increase (+ ~1MB per arch) and that is without the recent optimizations made by @link2xt

@adbenitez
Copy link
Collaborator

I remember I sometimes published DeltaLab with bigger size than expected due to some caches after several compilations, maybe try some cleaning before building

@r10s
Copy link
Contributor Author

r10s commented Jun 8, 2023

interesting, there is also some flakiness in the measurement above (see comment "idk, why the size decrease...") - any idea where this may come from?

wrt cleaning before building: yes, this is what i am also always doing 🧹

@link2xt
Copy link
Collaborator

link2xt commented Jun 8, 2023

Another improvement, setting codegen-units to 1: #4464

interesting, there is also some flakiness in the measurement above (see comment "idk, why the size decrease...") - any idea where this may come from?

Could be due to the default codegen-units = 16 and parallelization? May be the work is split differently depending on the order in which the cores finish their tasks.

There is a related upstream issue about codegen-units not being 1 for the releases by default: rust-lang/rust#47745

@link2xt
Copy link
Collaborator

link2xt commented Jun 8, 2023

I have just triggered a nightly build with #4461 merged in, size of the nightly is 67483126 bytes: https://download.delta.chat/android/nightly/2023-06-08/

Previous was 67951509 (https://download.delta.chat/android/nightly/2023-06-07/) and 67954600 (https://download.delta.chat/android/nightly/2023-06-06/).

So it looks as if #4461 alone is saving 0.4 MB.

@r10s
Copy link
Contributor Author

r10s commented Jun 8, 2023

building android 1.37 with #4464 we get a 4.6 mb smaller apk compared to default codegen-units. for better comparison with android 1.36.5, i also created a build of the old core with codegen-units=1:

android1.36.5, core112.8, codegen-units=16  56.3 mb
android1.36.5, core112.8, codegen-units=1   54.5 mb
android1.37, core116, codegen-units=16      62.4 mb
android1.37, core116, codegen-units=1       57.8 mb -> +3.3 mb compared to core112.8, codegen-units=1  

so, an increase of 3.3 mb for added jsonrpc and brotli, that's still something, but probably okay i'd say. from the original, too big, release of 1.37, we're down 10.1 mb :)

interesting, that default codegen-units increase android1.36.5 by 3% where it increases android1.37 by 8%. the new codegen-units=1 compilation is maybe better comparable.

nb: @link2xt i always call ./scripts/clean-core.sh before benchmarking/releasing, to have a clean start and not sth. in some caches that may break things - wondering if that script is sufficient?

@link2xt
Copy link
Collaborator

link2xt commented Jun 8, 2023

After merge of #4464 the size of nightly at https://download.delta.chat/android/nightly/2023-06-08/ is down to 62540285 bytes.

@r10s
Copy link
Contributor Author

r10s commented Jun 21, 2023

k, i think, we optimised the reasonable things and there is no actionable item left. thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants