Hello,I hope I'm not adding to the "my build is too slow" pile of emails, but this seems like an actionable concern.I saw this graph [1] and noticed that build times (measured by CPU hours) have more than doubled since July 2022. Between July 2018 and July 2022, they held relatively steady at about ~30-40 CPU hours (~40-50 hours between June 2020 and April 2021). Since then, they have steadily increased, now reaching ~85-90 CPU hours.The 5 year graph [2] shows the unusual trend more clearly.Assuming the data in the graph is accurate, this is concerning for external developers with limited resources like myself, who likely have limited resources to build Chromium on a regular basis. Based on the graph, developers are likely having to pay twice as much to build Chromium in cloud envs, or spend twice as long sword fighting [3]. Anecdotally, this seems true.Is there active work to analyze and lower, or at least stabilize, build times?Any work to stabilize build times is very much appreciated. If there's a big Good Reason™ that justifies the increasing build times, or I'm misinterpreting the graph, please disregard this email. :)
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4268b0c8-fdfa-48de-9b66-72d39e1c3061n%40chromium.org.
On Fri, Jun 28, 2024 at 2:21 AM Alesandro Ortiz <ales...@alesandroortiz.com> wrote:Hello,I hope I'm not adding to the "my build is too slow" pile of emails, but this seems like an actionable concern.I saw this graph [1] and noticed that build times (measured by CPU hours) have more than doubled since July 2022. Between July 2018 and July 2022, they held relatively steady at about ~30-40 CPU hours (~40-50 hours between June 2020 and April 2021). Since then, they have steadily increased, now reaching ~85-90 CPU hours.The 5 year graph [2] shows the unusual trend more clearly.Assuming the data in the graph is accurate, this is concerning for external developers with limited resources like myself, who likely have limited resources to build Chromium on a regular basis. Based on the graph, developers are likely having to pay twice as much to build Chromium in cloud envs, or spend twice as long sword fighting [3]. Anecdotally, this seems true.Is there active work to analyze and lower, or at least stabilize, build times?Any work to stabilize build times is very much appreciated. If there's a big Good Reason™ that justifies the increasing build times, or I'm misinterpreting the graph, please disregard this email. :)I think it would be a better graph if it was normalized for the number of files or lines of code. The codebase (and binary) keeps increasing in size. And FWIW C++ continues to get even more expensive (read: slow) to compile as it evolves.
----Regards,Alesandro
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4268b0c8-fdfa-48de-9b66-72d39e1c3061n%40chromium.org.
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAHtyhaRX09tFpkWTpea%2BRZW_Pybc-LKBcuzMwGB34dGBetD2AA%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4268b0c8-fdfa-48de-9b66-72d39e1c3061n%40chromium.org.
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
More CPU per file, or safety and correctness - both are speculation? We can guess at the root cause, but it seems like Chrome taking double the CPU to build today than it did in 2022 is an alarming trend that we'd want to understand?
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4268b0c8-fdfa-48de-9b66-72d39e1c3061n%40chromium.org.
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAHtyhaR-3f03qXbt1f2c-P3KYCMzcA0%3DoE18hoS5TsoVuDtB%3DQ%40mail.gmail.com.
> There's also somewhat inherently a conflict between build times and other (more important) properties like safety and correctness.Indeed. It is also worth noting that thea) The WebUI codebase has migrated from JavaScript TypeScript over the last few yearsb) More TS (and WebUI in general) code is being added at a high paceThe above means that there is more work needed to be done during the build which is unrelated to C++ (more files thrown to the TS compiler for type checking, more code thrown at other tools like Terser, Rollup and others when optimize_webui=true, more NodeJS invocations).For example the following commandgn ls -C out/gchrome | grep ":build_ts" | wc -l
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/4268b0c8-fdfa-48de-9b66-72d39e1c3061n%40chromium.org.
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAHtyhaRX09tFpkWTpea%2BRZW_Pybc-LKBcuzMwGB34dGBetD2AA%40mail.gmail.com.
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/90815654-94d0-427b-a78f-3b88d836ce6fn%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/b5ebf8e7-617d-484e-905a-fc3543d0f90fn%40chromium.org.
I'm on my phone, excuse typos.Build times can roughly be broken into "compile" and "link". Overall time is a function of both + parallelism.Compile times are mostly a function of input tokens, which you can sort of upper bound as O(n^2) in lines of code. (That's a terrible approximation, but whatever.) This is because compiling a single file requires compiling the transitive closure of the #include graph. Link times are closer to being linear in lines of code, but depend greatly on your build config (LTO and linking debug info are both slow) as well as things like your disk and memory bandwidth and free memory (linking a large target is extremely memory-hungry).Build times held steady for awhile because a bunch of people made a focused effort to remove unnecessary #includes and to split up commonly-#included files into smaller pieces. Think of this work as driving the n^2 compile time closer towards O(n). For the couple years that work went on, we basically kept pace with the increasing codebase size. Unfortunately, we have basically picked most of the low-hanging fruit there, which is a reason things have been getting slower again. C++20 didn't help, as it increased compile times by about 10%. (It does provide a lot of tools we could use to reduce compile times in the future, but you only benefit from those where you actually use them.)
There are two primary, not-mutually-exclusive paths forward. One is to resurrect the jumbo build from 2017. This concatenates source files into groups so you only pay the #include costs for one group at once, not every file. I am experimenting with this locally. It has promising effects on compile times but there are meaningful maintenance costs we have to pay if we go this route, so do not count on it happening.
The second is modules, either the pre-c++20 "clang modules" or true c++20 modules. These can be thought of a bit like "precompiled headers on steroids". The downside is that support in llvm is still buggy, we need build system support, and to take full advantage of c++20 modules we need to gradually rewrite ~all our current usage of header files. "Clang modules" provide less win but require far less effort. Unfortunately there is no current staffing on any of this work.What work has happened to date is primarily focused on the siso and reclient tools, which (respectively) replace ninja and goma. Depending on platform, they can improve build throughout, primarily for remote builds that are massively parallel. This way, in the limit, Google can "solve" high build times (at least for itself) by throwing more hardware at the problem. Reclient uses RBE, which to my knowledge is open and non-proprietary, and I believe the goal is to allow broad access to it (but not necessarily to Google's server clusters, which would probably only be accessible to Googlers; open source contributors would presumably need to put together a server pool on AWS or Google Cloud or something. Please assume I don't know anything here and everything I say is wrong).
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAAHOzFDvKezVicjHyRVJbOfYEXg6j6GDj7Vu4vhJZgM-t7u-GA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAOmohSLkLRoCtXeF2Q1kF_n144SZ%3Dj-uBvp2r-cXfqwL0Jg9Dg%40mail.gmail.com.
On Sat, Jun 29, 2024 at 9:54 PM Peter Kasting <pkas...@chromium.org> wrote:Build times held steady for awhile because a bunch of people made a focused effort to remove unnecessary #includes and to split up commonly-#included files into smaller pieces. Think of this work as driving the n^2 compile time closer towards O(n). For the couple years that work went on, we basically kept pace with the increasing codebase size. Unfortunately, we have basically picked most of the low-hanging fruit there, which is a reason things have been getting slower again. C++20 didn't help, as it increased compile times by about 10%. (It does provide a lot of tools we could use to reduce compile times in the future, but you only benefit from those where you actually use them.)I suspect that tools to detect unnecessary includes and/or cases where includes could be turned into forward declarations could go a long way to reduce that non-linearity.
Also, in the past, I've seen the use of the following pattern to avoid including the same header file multiple times:#ifdef WHATEVER_H_#include "whatever.h"
#endifThat helped avoid I/O operations in case of multiple included .h files all depending on the same .h file. It might be worthwhile to investigate.
There are two primary, not-mutually-exclusive paths forward. One is to resurrect the jumbo build from 2017. This concatenates source files into groups so you only pay the #include costs for one group at once, not every file. I am experimenting with this locally. It has promising effects on compile times but there are meaningful maintenance costs we have to pay if we go this route, so do not count on it happening.AFAICT, that's the approach WebKit took, but it should be noted that jumbo builds are no panacea.They optimize the "fresh build"/rebase case, but significantly increase the cost of small, iterative changes.Building WebKit from scratch takes an ~hour (compared to 8+ hours for Chromium), but a simple change takes ~90 seconds, compared to a few seconds.
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAAHOzFDT_TN3d0KWuPoXnpAdMY2kE7XppJ0DusvF%2B_%2B8Rmb3dA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAPi%2BNeVHpyGeF%2Bguzvb8b7FyPuQ%2BMeR1fxOMMAGWf8t7mD%2BuBg%40mail.gmail.com.
Looking at time/unit, it's clear to me that we need to switch back to C. 😛This is some really interesting data. The Blink binding generation stands out, for example; that seems painful to regenerate any time it changes, but maybe it doesn't change much?
Clang plugin also makes build slower https://crbug.com/333005905#comment13.It might help if you set clang_use_chrome_plugins=false in args.gn.