r/programming • • May 25 '19

Making the obvious code fast

https://jackmott.github.io/programming/2016/07/22/making-obvious-fast.html
1.3k Upvotes

263 comments sorted by

View all comments

Show parent comments

0

u/cranecrowfrog May 26 '19 edited May 26 '19

while the second is a standard library and not any sort of language runtime. Third, comparing C++ hello world written with <iostream> with C hello world written with <stdio.h> and claiming that the difference is due to "language runtimes" is laughable

What you'd prefer to call a library or standard library (and is called such on linux), Microsoft calls a runtime (google Visual C++ runtime aka msvcprt, etc) & now you're arguing about pedantics, while intentionally trying to belittle/insult me.

libgcc and libstdc++ aren't remotely comparable. The first is a low-level runtime library that is usually linked statically (in which case there is no "loading" involved beyond that of the executable itself),

INCORRECT, libgcc is almost never linked statically, this is very rare on most linux distros & is dynamic by default, ldd any gcc compiled binary, this is why the -static-libgcc / -static flags exists. That makes no sense what you said, you sound really fucking stupid buddy, that's laughable what you just said. Man, it must suck to work with you.

Lol, that's how you talk.

https://stackoverflow.com/questions/26304531/compiling-with-static-libgcc-static-libstdc-still-results-in-dynamic-depende

Fourth, "initialization" for what? This C++ example uses std::array, which is literally a static C array in a type-safe wrapper,

Yes as I said my c++ is rusty & I checked & I was wrong about that & removed it.

Fifth, C++'s what warmup time? You didn't seriously just imply that C++ is JIT compiled, did you?

I put quotes around it you fuckhead, that implies it has a different meaning, my c++ is rusty but not non existant.

Anyway, my entire point is that isn't how you measure code speed, and wouldn't fly on code golf or real world unit tests.

Edit - libgcc = GNU libc, c runtime, libc.so, etc

6

u/acwaters May 26 '19 edited May 26 '19

You're thinking of (g)libc. Libgcc is a different library. And libc doesn't generally load any faster or slower than libstdc++ or libc++ or whatever MSVC's DLL is called.

Yeah, though, I came off like a total ass before, didn't I? Sorry about that. Thanks for calling me out on it.