3 ms·
I think go would have gotten a lot more love from C and C++ users if they weren't so resistant to having an optimizing compiler. I'm not referring to removing
by pclmulqdq 4y ago
I think go would have gotten a lot more love from C and C++ users if they weren't so resistant to having an optimizing compiler. I'm not referring to removing bounds checks - I'm referring to things like stack-passed function arguments and the normal optimization passes that you get from -O2 in gcc. Sometimes you want a slow compiler that does a lot of heavy lifting.
Now, Rust is the new hotness and it doesn't make a lot of sense to use other things if you care about both safety and speed.
- bugfix-66 4y agoWell, to begin with, Go passes function arguments in registers since 1.17 Go 1.17 implements a new way of passing function arguments and results using registers instead of the stack. Benchmarks for a representative set of Go packages and programs show performance improvements of about 5%, and a typical reduction in binary size of about 2%. (https://go.dev/doc/go1.17 https://go.dev/doc/go1.17) I think the basic problem here is that you don't know the facts.
- pclmulqdq 4y agoI think you misunderstand my point: The problem is that it took until around 2020 for this work to start. Around 2015, a lot of would-be adopters from C and C++ didn't jump on the Go bandwagon because of the perf gap. I use Go a lot today, as a former user of both C and C++, but Rust is probably better as a C/C++ replacement.