Thank you, I know what opportunity cost means, and in this case it's a technical debt that is thrown resources at because it's cheaper than developers' time (so far).
I perfectly understand that a laptop will always have a hard time building big projects, but I want to differentiate AOSP in two aspects:
1. It's not just slow builds, but some "peculiarity" in the build system that causes enormous memory allocations. Even when building on strong cloud machines or corporate PCs overloaded with RAM, I guess there can be a significant slowdown when frequently rebuilding the images or doing "will it compile" checks. For comparison, building the kernel is much faster and can be done with just about 4GB of memory.
2. Incremental syncs should be fast, but it seems they aren't. On a "student's PC" it takes almost the same time to do an incremental build after updating a single Android.bp file as a full build, although it's expected to build just "the things that changed and their dependencies". Here I suspect that I'm doing something wrong, because incremental builds should always be faster. I never encountered this issue with make/cmake projects.
> if that's the most valuable bug for you to fix, go for it!
Before leaping with fixes, I think it's reasonable to consult Android devs. Maybe the resource consumption is justified and there's nothing to fix? Or maybe there's already an open issue and people working on it? That's why I opened this topic - to get the minimal direction.
To make it transparent, I'm adding a HAL implementation for a custom device, and the initial checks take a lot of time. Maybe there's a way to isolate this development completely from the main tree and load the library files to an existing image... Again, I hoped the build system can do it for me, in incremental fashion.
Thank you for guidance anyway
On Friday, October 17th, 2025 at 7:56 PM, 'enh' via Android Building <
android-...@googlegroups.com> wrote:
> On Fri, Oct 17, 2025 at 12:13 PM 'asquator' via Android Building
>
android-...@googlegroups.com wrote:
>
> > I fear it's not about opportunity cost,
>
>
> i fear you need to read
https://en.wikipedia.org/wiki/Opportunity_cost :-)
>
> in this specific case: imagine you have 40 hours for fixing bugs this
> week. do you spend that on reducing memory usage for the tens of
> hobbyists/students who're trying to build an entire OS on a laptop ...
> or do you spend that time on fixing something that the billions of
> actual users will notice? because you only get to spend those 40 hours
> once.
>
> > but a lack of optimization. For example, I've recently synced my AOSP build and it took just one minute, meaning there's nothing to do. When I added a single binary module and triggered a build, I had to wait for 65 minutes before it finished. The build process was constantly consuming 12gb + 32gb memory (the latter being swap). Something is definitely wrong here, as incremental builds should be quick. Why is so much memory used when adding just one module? Is the entire source tree re-scanned in memory? What's the chance I'm doing something wrong? All this time the build was hanging with the lines:
> >
> > [100% 1/1] bootstrap blueprint
> > Running globs...
> >
> > I'm syncing in ASfP.
> >
> > Developing on commodity machines is made somewhat impossible, as it may take hours to include any addition in the module graph, and the PC becomes unusable at that moment.
>
>
> sure, but it's already "somewhat impossible" because there's an entire
> operating system's worth of code to build, so anyone trying to
> actually get anything done is going to get a huge return on investment
> from buying a more ram and more/faster cpu cores. because again, you
> only get to spend your 40 hours one way, and hours spent "waiting for
> an entire operating system to build on a laptop" rather isn't going to
> help any of those billions of users...
>
> 16GiB wasn't enough to build comfortably a decade ago. and while, yes,
> if you were their boss you could have an engineer try to reduce those
> requirements ... but you'd have a hard time justifying to your boss
> To view this discussion visit
https://groups.google.com/d/msgid/android-building/CAJgzZorN-HADk8QYEvshmXkR65M5%3DaeZxwiPadFSLZMyPSax_w%40mail.gmail.com.