

Business Card Ray Tracer: Go vs C++ - kid0m4n
https://kidoman.com/programming/go-getter.html?noreaally

======
diydsp
Umm... talk about missing the point. The C++ version fits onto a business
card. it's 35 lines by 37 characters wide. (1295 bytes)

The Go version is 229 lines (6.5x as long) and 4255 bytes long (3.2x as long).
Fit that on a business card...

Your title should be "Go program optimized for speed faster than C++ program
optimized for code size" and you should stop trying provoke people with false
comparisons.

~~~
kid0m4n
I am happy to rerun the benchmarks (single threaded and multi threaded) with a
optimized C++ version. Sadly, been a while since I last worked on C++

The base C++ version, for reference:
[https://gist.github.com/kid0m4n/6680629](https://gist.github.com/kid0m4n/6680629)

But its never going to be apples-to-apples comparison. Given the different
feature sets of either platform

But this definitely shows that Go performance is in the same ballpark though.

~~~
DerekL
I'd need to use a profiler to be sure, but the first thing I'd try is to
replace the printf call for each pixel with an fwrite.

~~~
kid0m4n
I am trying my hand at a few things... will keep this in mind

