<story><title>A Rust optimization story</title><url>https://quickwit.io/blog/search-a-sorted-block/</url></story><parent_chain></parent_chain><comment><author>colatkinson</author><text>For what it&amp;#x27;s worth, it appears a C++ version [0] of that binary search algorithm with Clang 13 requires 9.45 cycles [1]. The clang++-generated ASM is quite similar to the rustc-generated ASM in the article. Not sure what accounts for the difference from the C++ implementations the author was comparing against.&lt;p&gt;Regardless, it&amp;#x27;s neat to see the two languages are so close in performance here. I wonder if down the line, the richer information about lifetimes, etc. that Rust provides will allow optimizations beyond those available to C++ -- or if this is already the case.&lt;p&gt;[0] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;godbolt.org&amp;#x2F;z&amp;#x2F;Mj7PWevex&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;godbolt.org&amp;#x2F;z&amp;#x2F;Mj7PWevex&lt;/a&gt;
[1] &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;bit.ly&amp;#x2F;3CawbUe&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;bit.ly&amp;#x2F;3CawbUe&lt;/a&gt;</text></comment>
<story><title>A Rust optimization story</title><url>https://quickwit.io/blog/search-a-sorted-block/</url></story><parent_chain></parent_chain><comment><author>mwcampbell</author><text>I wonder what critics of optimizer-oriented programming, such as Marcel Weiher (mpweiher), think of this post. Weiher has been repeatedly critical of Swift for relying way too much on LLVM&amp;#x27;s optimizations; I wonder if Rust, with its emphasis on zero-overhead abstraction, falls into the same category for him.</text></comment>