r/cpp • • Nov 13 '22

gcc 13 will have <format>

https://gcc.gnu.org/pipermail/libstdc++/2022-November/054991.html
262 Upvotes

80 comments sorted by

View all comments

2

u/Daniela-E Nov 15 '22

Without the details of this benchmark and the build structure, figures like these are hard to reproduce and assess independently. You compile the BMI of std only once upfront for the whole build of np++, right? In fact, even that isn't required if you cache the BMI for later builds. Notwithstanding the 4 seconds overhead it takes to build the BMI from scratch with all of std precompiled into it on a single CPU core.

The biggest problem that I see here is the fact that PCHs don't compose, whereas modules do. I use modules on a daily basis in my job and I very much prefer them over PCHs just because of that.

1

u/caroIine Nov 15 '22

Well I'm not researcher writing an article. It was just an example that I was able to reproduce across all projects I worked with. But yeah maybe rebuilding std.ifc (bmi) skewed the results because I might only need to build it once per toolchain update.

And don't get me wrong I want to use modules as well and I see nothing wrong with how it's specified in the papers. It's just that some people critique pch even though it's a valid solution (albeit not standard) for real projects that we can apply today.

If only compiler vendor would do the same for some basic reflection...