Enabling new compile-size check in CQ

77 views
Skip to first unread message

Erik Staab

unread,
Feb 27, 2025, 9:31:01 PM (8 days ago) Feb 27
to chromium-dev
Hi all,

In order to prevent unintentional build time increases, I will be enabling a new compile-size builder in CQ that will fail on CLs that increase the C++ compiler input size by over 300 MiB.

Compiler input size tracks closely with the amount of time spent in the build but is much easier to measure because of its determinism. The builder measures compile size with and without the CL and measures the difference. See background in the design doc.

What if my CL fails?
The failure will link to this doc, which has info about navigating the builder, links to forward declaration tips, reproduction instructions, and more. If all else fails you can override the check with Compile-Size: <reason> in a Gerrit footer in your CL description.

How often will CLs be blocked?
Looking over January, a couple of CLs per week on average exceeded the 300 MiB threshold. Each of them either could have been modified to use forward declarations to stay under the size limit or were worthy of discussion.

Please reach out to me with questions.

Thanks,
Erik

James Cook

unread,
Feb 28, 2025, 7:08:03 PM (7 days ago) Feb 28
to Erik Staab, chromium-dev
Would it make sense to relax this part of the style guide?

"However, if it would otherwise make sense to use a type as a member by-value, don't convert it to a pointer just to be able to forward-declare the type."

We could delete that line and allow developers to decide if "Foo foo_;" or "std::unique<Foo> foo_;" was more appropriate in their class.

For non-performance-critical code, I suspect the benefits of unique_ptr and forward declaration in build time and resource utilization might outweigh the runtime performance cost.

James

--
--
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 visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAN60yaJDiTsYeC0oaXqL1Wvb1ZJGkc0HJLV0%2BRdaaPUMVyVyuQ%40mail.gmail.com.

Daniel Cheng

unread,
Feb 28, 2025, 7:16:35 PM (7 days ago) Feb 28
to jame...@chromium.org, Erik Staab, chromium-dev
I don't think we should encourage std::unique_ptr just so people can forward declare. Even when internal Google style still preferred forward declares, it was explicitly discouraged from using std::unique_ptr just to forward declare.
There might be some limited instances where we do this anyway, but it should be an exceptional case.

Daniel

Reply all
Reply to author
Forward
0 new messages