C++'s runtime is C's runtime — plus some extra bits
I took the poster to be saying exactly the same thing - but since c++ is larger it will take a little longer to load.
Even if you don't use anything from it, the OS is going to do extra work loading the lib. If it's statically linked then there's going to be more disk loads or memory pages to set up. Marginal? Yes, but that's why they were talking in the order of a few ms.
The few extra bits of runtime that C++ has are supplied in separate libraries on most platforms and are usually linked dynamically, so they won't incur any up-front loading time; they'll only be lazily loaded when (if) they're actually used. The statically linked bits like libgcc are common to C and C++, so there'll be no difference there. While C++ does typically produce larger binaries than C (sometimes substantially so), the difference between loading a 6K binary and a 12K binary (say) is not going to be on the order of milliseconds; using the parent commenter's suggestion of time ./a.out, you won't even be able to measure it. (It's funny, but a few milliseconds is not marginal when we're talking about native code; it's actually an eternity!)
3
u/swansongofdesire May 26 '19
I took the poster to be saying exactly the same thing - but since c++ is larger it will take a little longer to load.
Even if you don't use anything from it, the OS is going to do extra work loading the lib. If it's statically linked then there's going to be more disk loads or memory pages to set up. Marginal? Yes, but that's why they were talking in the order of a few ms.