what was the overall compilation time though, Mr. Ravishankar? (Also, what branch/tag, board and make target were used?)
For those who is limited with resources, It can be stripped even more, (one can save ~16gb by removing .repo dir, some memory can be recovered by using zram/compressed swap, and couple more gbs can be saved by using btrfs with compression set to zstd=3,
mount ... -o compress=zstd:3
btrfs property set /build/aosp/out compression ""
To get some extra boost to compilation speed (in this configuration it'll be more about preventing CPU choking), pass "mitigations=off selinux=0 audit=0" as kernel options and reboot; to run builds, try to stay lean (make snod, m - ok, make all - not ok since it'll build some tests).
And since this is not super obvious for some people, -Xmx4g is required in this case because Java won't allocate enough heap without it, if there's not enough physical memory. To investigate what takes time, one can open build trace:
> Just open $OUT_DIR/build.trace.gz in Chrome’s chrome://tracing,