Remix.run Logo
levodelellis 2 hours ago

In fact, I don't believe you so much that I'm willing to say you're full of shit. No compiler capable of both C++ and C will be twice as fast renaming the file to C

jsheard 2 hours ago | parent [-]

I agree it shouldn't really matter if there's no C++ features in play, but I suppose third party headers could bite you if they use #ifdef __cplusplus to guard optional C++ extensions on top of their basic C interface. In that case the compiler could be dealing with dramatically more complex code when you build in C++ mode.

uecker an hour ago | parent [-]

Maybe it is similar for the same compiler (but one should check, I suspect C could still be faster), but then there are much more C compilers. For example, TCC is a lot faster than GCC.

levodelellis 38 minutes ago | parent [-]

tcc is 8x faster, twice as fast isn't doing it justice.

As for the header thing, that'd could potentially be true if the compile time was something like 450ms -> 220ms, but why bother saying it when you're only saving a few hundred milliseconds