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 embedded BoringSSL build #447

Merged
merged 1 commit into from
Apr 3, 2019
Merged

Optimize embedded BoringSSL build #447

merged 1 commit into from
Apr 3, 2019

Conversation

ilammy
Copy link
Collaborator

@ilammy ilammy commented Apr 2, 2019

Don't build unnecessary libraries, binaries, tests, etc. Build only two static libraries that we need. This results in considerable time saving during the builds: BoringSSL contains quite a few tests and tools which we do not run and use, yet they get built.

Native

Before:

$ time make all ENGINE=boringssl

real    4m36.341s
user    3m44.060s
sys     0m33.924s

After:

$ time make all ENGINE=boringssl

real    1m56.910s
user    1m29.960s
sys     0m19.392s

Nuff said.

Android

Before:

$ time ./gradlew --no-daemon --no-parallel --max-workers=2 assembleDebug

real    34m46.028s
user    29m9.580s
sys     6m39.280s

After:

$ time ./gradlew --no-daemon --no-parallel --max-workers=2 assembleDebug

real    12m46.028s
user    9m1.880s
sys     2m52.020s

Admittedly, the difference may be smaller—as we still have to wait for Gradle to download the whole Internet during Android build—but that's still a significant improvement because there are four architectures that we need to build BoringSSL for.

Don't build unnecessary libraries, binaries, tests, etc. Build only two
static libraries that we need. This results in considerable time saving
during the builds: BoringSSL contains quite a few tests and tools which
we do not run and use, yet they get built.

Native
------

Before:

    $ time make all ENGINE=boringssl

    real    4m36.341s
    user    3m44.060s
    sys     0m33.924s

After:

    $ time make all ENGINE=boringssl

    real    1m56.910s
    user    1m29.960s
    sys     0m19.392s

Nuff said.

Android
-------

Before:

    $ time ./gradlew --no-daemon --no-parallel --max-workers=2 assembleDebug

    real    34m46.028s
    user    29m9.580s
    sys     6m39.280s

After:

    $ time ./gradlew --no-daemon --no-parallel --max-workers=2 assembleDebug

    real    12m46.028s
    user    9m1.880s
    sys     2m52.020s

Admittedly, the difference may be smaller--as we still have to wait for
Gradle to download the whole Internet during Android build--but that's
still a significant improvement because there are four architectures
that we need to build BoringSSL for.
@ilammy ilammy added O-Android 🤖 Operating system: Android W-JavaThemis ☕ Wrapper: Java, Java and Kotlin API C-BoringSSL Crypto provider: BoringSSL labels Apr 2, 2019
@Lagovas
Copy link
Collaborator

Lagovas commented Apr 2, 2019

awesome, how you find it?)

Copy link
Contributor

@vixentael vixentael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omg yes!
I was secretly waiting for this for so long 🤯🔥💃

(I wish Gradle not downloading the whole Internet every time)

@ilammy
Copy link
Collaborator Author

ilammy commented Apr 2, 2019

Hm... Integration tests and x86_64 build fail on CircleCI at the moment because CircleCI builders seem to be throttled by Canonical's repositories and can't update all packages in time. I hope this is a transient issue.

Anyway, I looked at Android build on CircleCI.

  • Before: 5:58 build (12:27 total)
  • After: 2:49 build (8:34 total)

I'll take it.

@ilammy ilammy marked this pull request as ready for review April 2, 2019 13:34
@ilammy ilammy merged commit 3728950 into master Apr 3, 2019
@ilammy ilammy deleted the ilammy/optimize-cmake branch April 3, 2019 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-BoringSSL Crypto provider: BoringSSL O-Android 🤖 Operating system: Android W-JavaThemis ☕ Wrapper: Java, Java and Kotlin API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants