--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CALNjmMoWstkpntP%2B0xJC0wWitgYMVPJsvd7%3D8HKOPaQ7eiZoBw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAB8jPhcgeMYBvrzPm2vtgWWgBkXOCYSEa0ZRgNC-Rg%3DYATEwLQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CALgg%2BHGd6Xi%2BaQD3pe60tPnkrPE4hc1jR0%2BG0N2W1QbuT%2Ba7%3Dw%40mail.gmail.com.
There's a good reason Chromium has used forward declarations since the beginning, and also projects that it depended on like WebKit.
I think the internal style guide is wrong, but that it can work in an environment with virtually unlimited build resources. (It could also work in a C++20 Modules environment, but that seems some way out still.)
Include bloat is real, and reducing it by using forward declarations has substantial impact.
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFCKOgo-B%2BM5VApC3JOUhdk4zWQPY8OvRtj-DN3RsCCUHA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAF3XrKrwAgTOtUZHOCcjoET4KYkYr0izCX1ia5Qd-CcdYQf9gg%40mail.gmail.com.
> Chromium has never seriously experimented with a no-forward-decls policy.I'm not sure what kind of experiments this refers to, but we do have lots of data showing that forward declarations have big compile time effects. Hans linked to a bunch.
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFCGZL3SZWLdwRdkQezU7wJjVL6zEFXipThiyW8nnrp_UQ%40mail.gmail.com.
On Tue, Aug 6, 2024 at 12:52 PM Peter Kasting <pkas...@chromium.org> wrote:What I was trying to say is that while we know that, in our current world, replacing specific heavyweight #includes with forward decls can reduce tokens (and in the aggregate thus lower build times), we don't know what other worlds are like, because we weren't ever in them. We didn't start with a "no forward decls" policy and then move away from it; we started here.Not true. We used to not use forward headers for mojo-generated code for example, changed that to forward decls, and it was a big win.
does anyone know how much C++20 modules help with build times?
Would they mitigate the costs of not using forward declarations?
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFAT6BnU_By-GA1zMGE%3DZdzoA2kwpCWzSkNeLh5MD-6fnw%40mail.gmail.com.
Thank you for your feedback and some references!For now, it seems that we prefer to choose build performance rather than discouraging forward declaration and we also want to evaluate modules more for build times.As far as I know, there is https://crbug.com/40440396 to use C++ modules in chromium.
So I changed my mind not to pursue clang's include cleaner until when it has support for forward declaration as we want.Instead, I'll take a look at C++ modules and IWYU to see whether we can reduce build time more.
Thanks,Takuto--On Wed, Aug 7, 2024 at 3:23 AM Peter Kasting <pkas...@chromium.org> wrote:--On Tue, Aug 6, 2024 at 11:15 AM Daniel Cheng <dch...@chromium.org> wrote:does anyone know how much C++20 modules help with build times?Not clear; the closest thing to Chromium that has released any numbers is the Microsoft Office transition to modules, but even there they're not actually done yet; they have been incrementally coalescing their build system. They also were using a heavily-optimized PCH setup extensively, so their starting point is not the same.I have seen estimates for a net benefit for Chromium compile times anywhere from 10%-50% from today. Given that jumbo alone cuts CPU seconds for compile time by about 50% and modules are likely to be more effective overall, I would probably lean towards the high side of that range, but CPU seconds are not wall clock seconds.Coincidentally, I was linked to https://github.com/ChuanqiXu9/clang-modules-converter today, which might be useful once we do want to move toward modules.Would they mitigate the costs of not using forward declarations?Yes.PK
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAAHOzFAT6BnU_By-GA1zMGE%3DZdzoA2kwpCWzSkNeLh5MD-6fnw%40mail.gmail.com.
You received this message because you are subscribed to a topic in the Google Groups "cxx" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/cxx/hQWQFZxUhwg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cxx+uns...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CALNjmMr0OR34QQYH_nraNogK4eXyE7msJRk%3DJXB0cf%2BHTTmSrA%40mail.gmail.com.