Go vs C++: performance comparison to business card ray tracer

This is a 3-part series article about Go vs C++ in implementing a raytracer (part2 & part3). To quote the summary:

After optimizations, the Go ray tracer was 8.4 % faster than a functionally equivalent C++ (but unoptimized*) version when rendering a 4.2 MegaPixel image using a single thread. With multi-threading enabled, the performance gap widened to 76.2 % on a 8 Core machine. Not only was it really simple to utilize the complete CPU in Go, it was easy to immediately feel productive in the language due to its simple and thoughtful design.

The performance comparison isn’t really fair though, given the C++ implementation is unoptimized. With an optimized C++ version in the third part of the article, C++ won by 2x. However, the author makes the case that Go makes multicore programming simpler. I’m not really familiar with Go to make that judgement, but with C++11 and the plethora of libraries available, you can have similar multicore programming constructs in C++. It’s a cool exercise nevertheless.

Click here to visit link (kidoman.com)


Commenting will be coming soon. In the meantime, feel free to create a discussion topic on the forums.