Re: [android-building] Soong regenerate after any Android.bp change slow

1,951 views
Skip to first unread message
Message has been deleted
Message has been deleted

Michael Swartout

unread,
Feb 6, 2023, 3:01:21 PM2/6/23
to android-...@googlegroups.com
Lucky yours only takes 60 seconds. It takes 18 minutes, everytime I make a change to almost anything.

On Wed, Feb 1, 2023 at 9:29 PM Dean Wheatley <dw...@dolby.com> wrote:
Is there a better/faster way to develop Android.bp in the AOSP tree than waiting for the many (> 60) seconds it takes to "analyzing Android.bp files and generating ninja file at out/soong/build.ninja" after any change to any Android.bp file in the tree?

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/e19325ce-2798-4d80-8de8-b0312c7bb69an%40googlegroups.com.

enh

unread,
Feb 6, 2023, 3:04:25 PM2/6/23
to android-...@googlegroups.com
(yeah, anecdotally "about a minute" sounds about right for the
machines developers at google have. i've seen 2-3 minutes too.)
> To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/CAEq4fyCTGiHjboJaFXnBbN_kBTJwjOvuWoTg_-7D%3Dx6Qq3c7UA%40mail.gmail.com.

Dean Wheatley

unread,
Mar 3, 2023, 2:08:04 PM3/3/23
to Android Building
Wow, 18 minutes, that's unbearable.

Dean Wheatley

unread,
Mar 13, 2023, 11:00:07 PM3/13/23
to Android Building
Any hints from Googlers on how to improve this?
Message has been deleted

enh

unread,
Mar 14, 2023, 11:56:11 AM3/14/23
to android-...@googlegroups.com
yeah, unfortunately i'm only aware of two options, and they're both basically "throw money at the problem until it goes away":

1. get a better computer. (256 GiB of ram, 64 cores, and 2 TiB of ssd are the current default.)

2. build in the cloud. https://cs.android.com/android/platform/superproject/+/master:build/soong/docs/rbe.md has some details, but i'm not sure there's a step-by-step guide anywhere.

(google actually uses _both_ together, so although i can personally vouch for "1 without 2" as useful and "1 and 2" as useful, i've never tried "2 without 1".)

On Tue, Mar 14, 2023 at 8:26 AM Michael Swartout <michaelc...@gmail.com> wrote:
I overcame that issue, changing 18 minutes into 3 minutes now. By changing my 24gb of memory that was only 2400mhz., into 32gb of memory at 3200mhz. And it was unbearable for me also. Soong only analyzes after certain things you do in the source code. For sure, after a mk or or bp file change. It won't do it if you have compiled a library or libraries already and it is a dependency of the library or binary you are trying to currently compile.

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.

Michael Swartout

unread,
Mar 14, 2023, 12:19:36 PM3/14/23
to android-...@googlegroups.com
You purchased way to much, overkill.

enh

unread,
Mar 14, 2023, 12:24:54 PM3/14/23
to android-...@googlegroups.com
depends how much you value your time. we have graphs somewhere where we actually did the experiment of adding memory and cores. iirc the impact of more memory does top out somewhere around 128GiB, but since everything grows and 256 is the next step up, that gives some breathing room to keep these machines useful. (similarly with disk space, though it's always easier to add disk space after the fact than it is memory.)

Christopher Nugent

unread,
Mar 14, 2023, 12:30:46 PM3/14/23
to android-...@googlegroups.com
I feel you. I splurged on a Threadripper Pro 24-core machine with 128 GB of RAM and 960 GB Intel optane source code storage drive because I wanted to spend what I could afford to minimize the time I spend waiting for Android ROM builds.

洪归风

unread,
Sep 18, 2023, 10:16:13 PM9/18/23
to Android Building
Can you reduce compile times simply by upgrading to faster memory? I'm encountering a similar issue where it takes about 10 minutes to generate the ninja file. I currently have 64GB of memory, but it's running at a speed of only 2133MHz. Therefore, I'm wondering if I should upgrade my memory or my CPU.
在2023年3月14日星期二 UTC+8 23:26:05<Michael Swartout> 写道:
I overcame that issue, changing 18 minutes into 3 minutes now. By changing my 24gb of memory that was only 2400mhz., into 32gb of memory at 3200mhz. And it was unbearable for me also. Soong only analyzes after certain things you do in the source code. For sure, after a mk or or bp file change. It won't do it if you have compiled a library or libraries already and it is a dependency of the library or binary you are trying to currently compile.

enh

unread,
Sep 19, 2023, 10:05:53 AM9/19/23
to android-...@googlegroups.com
i'd guess upgrading your cpu would have more benefit --- but note that
more threads is more important than single-core performance.
> To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/7e8f2c99-c95b-4768-b0f2-00481a31b716n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages