Skip to content
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

Optimize release builds and dependencies for size #4124

Merged
merged 1 commit into from
Mar 3, 2023
Merged

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Mar 2, 2023

We have decided not to enable it previously because of Windows CI failures: #1087

Let's see if it works now.

@link2xt
Copy link
Collaborator Author

link2xt commented Mar 2, 2023

This saves around 5 out of 19M (down to 14M) for arm64-v8a android library, although I measured with jsonrpc feature enabled.

@Simon-Laux
Copy link
Member

Simon-Laux commented Mar 3, 2023

how does this affect runtime performance?

@link2xt
Copy link
Collaborator Author

link2xt commented Mar 3, 2023

Size of the APK is reduced roughly from 59M to 54M as a result of this.

Measured by running

$ scripts/ndk-make.sh && ./gradlew --no-daemon assembleGplayDebug && ls -lah build/outputs/apk/gplay/debug/

in the android repo.

@link2xt link2xt force-pushed the link2xt/opt-size branch from 20033af to 3eca8f6 Compare March 3, 2023 12:48
@link2xt
Copy link
Collaborator Author

link2xt commented Mar 3, 2023

how does this affect runtime performance?

The core does not do anything CPU-intensive except for encryption, so it probably does not change much.

Benchmarking the tests on this branch:

Benchmark 1: cargo test --tests --release -- --skip test_oauth_from_mx --skip test_get_oauth2_token --skip oauth2::tests::test_get_oauth2_addr --skip configure::tests::test_no_panic_on_bad_credentials
  Time (mean ± σ):     23.088 s ±  0.988 s    [User: 89.600 s, System: 56.339 s]
  Range (min … max):   20.172 s … 24.156 s    20 runs

On previous commit:

Benchmark 1: cargo test --tests --release -- --skip test_oauth_from_mx --skip test_get_oauth2_token --skip oauth2::tests::test_get_oauth2_addr --skip configure::tests::test_no_panic_on_bad_credentials
  Time (mean ± σ):     22.603 s ±  0.382 s    [User: 87.051 s, System: 55.246 s]
  Range (min … max):   21.632 s … 23.133 s    20 runs

Benchmarking script is at #4126

@link2xt link2xt force-pushed the link2xt/opt-size branch from 3eca8f6 to 3fd493c Compare March 3, 2023 16:06
@link2xt link2xt merged commit 260dbbd into master Mar 3, 2023
@link2xt link2xt deleted the link2xt/opt-size branch March 3, 2023 18:43
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

Successfully merging this pull request may close these issues.

3 participants