<story><title>Go vs C++: Ray tracer (part 3)</title><url>https://kidoman.com/programming/go-getter-part-3.html</url><text></text></story><parent_chain></parent_chain><comment><author>eliasmacpherson</author><text>&lt;a href=&quot;https://kidoman.com/images/go-vs-cpp-after-both-optimized.png&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;kidoman.com&amp;#x2F;images&amp;#x2F;go-vs-cpp-after-both-optimized.pn...&lt;/a&gt;&lt;p&gt;In this picture - am I right in interpreting it at 2048x2048 and 8 cores, that the optimised and tuned go code is nearly three times faster than the multithreaded optimised and tuned C++ code? How come the C++ is the same for 1C and 8C? Is this picture from one of the previous articles?&lt;p&gt;EDIT: (No, I&amp;#x27;m wrong, the C++ is single threaded!)&lt;p&gt;It seems it&amp;#x27;s single threaded - and the last graph isn&amp;#x27;t showing the current level of C++ single threaded performance - which is ~36 seconds, with go at 21s for 8 threads. Final state of play is go at 18s multithreaded and C++ at 8s multithread and go at 81s single threaded and C++ at 36s single threaded. I read that from the third last graph.&lt;p&gt;It&amp;#x27;s difficult to understand this ending of the article, as the subtitle is:&lt;p&gt;&amp;quot;Further optimizations and a multi-threaded C++ version&amp;quot;
and
&amp;quot;Hurray multi-threading&amp;quot;&lt;p&gt;I suggest the order of the article be changed around to have a &amp;#x27;recap on single threaded C++&amp;#x27; at the start, and then the new figures - so that it concludes in straightforward manner.&lt;p&gt;This quote from the article is wrong:&lt;p&gt;&amp;quot;C++ is not more than twice as fast than an equivalent Go program at this stage.&amp;quot;&lt;p&gt;Correct me if I&amp;#x27;m wrong, but in every case that I can see the C++ code will execute twice before the Go code is finished. It is more than twice as fast.&lt;p&gt;By the same logic this &amp;quot;almost&amp;quot; is also wrong: &amp;quot;From taking 58.15 seconds (single threaded), it has now dropped to a extremely impressive 36.36 seconds (again single threaded), making it almost twice as fast as the optimized Go version.&amp;quot;&lt;p&gt;36s &amp;lt; 81s&amp;#x2F;2</text></comment>
<story><title>Go vs C++: Ray tracer (part 3)</title><url>https://kidoman.com/programming/go-getter-part-3.html</url><text></text></story><parent_chain></parent_chain><comment><author>buster</author><text>This has been circulated on the Rust-dev mailinglist:&lt;p&gt;&lt;a href=&quot;https://mail.mozilla.org/pipermail/rust-dev/2013-September/005735.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;mail.mozilla.org&amp;#x2F;pipermail&amp;#x2F;rust-dev&amp;#x2F;2013-September&amp;#x2F;0...&lt;/a&gt;&lt;p&gt;Rust did quite well (given that it&amp;#x27;s not even production ready i&amp;#x27;d say it&amp;#x27;s impressive): &lt;a href=&quot;https://mail.mozilla.org/pipermail/rust-dev/2013-September/005750.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;mail.mozilla.org&amp;#x2F;pipermail&amp;#x2F;rust-dev&amp;#x2F;2013-September&amp;#x2F;0...&lt;/a&gt;&lt;p&gt;The only thing they noted was that the Go version &amp;quot;cheated&amp;quot; by precomptuing some values which someone removed to make the algorithms the same.. maybe kid0m4n can comment on this :)</text></comment>