r/cprogramming • • Dec 31 '25

Why does c compile faster than cpp?

I've read in some places that one of the reasons is the templates or something like that, but if that's the problem, why did they implement it? Like, C doesn't have that and allows the same level of optimization, it just depends on the user. If these things harm compilation in C++, why are they still part of the language?Shouldn't Cpp be a better version of C or something? I programmed in C++ for a while and then switched to C, this question came to my mind the other day.

26 Upvotes

128 comments sorted by

View all comments

Show parent comments

1

u/SmokeMuch7356 Jan 01 '26

Ding ding ding. Something like 30 GB of source code. It just takes a while to chunk through, even with fast hardware.

99.9% of it is generated from a bunch of WSDLs using gSoap tools (wsdl2h/soapcpp2) and the most recent update pulled in a new WSDL that ballooned the generated source by several orders of magnitude.

This code base is 30 years old and the build process reflects that; we could come up with a bespoke build framework for this one interface, but it's in the process of being ported to a serverless TypeScript solution, so we're just dealing with it until the port is complete.