<story><title>Safety vs. Performance. A case study of C, C++ and Rust sort implementations</title><url>https://github.com/Voultapher/sort-research-rs/blob/main/writeup/sort_safety/text.md</url></story><parent_chain><item><author>teunispeters</author><text>Glad to C doing so well at what it&amp;#x27;s best at - efficiency and size.
I worked in embedded space for years.  Rust does not suit that environment.&lt;p&gt;Different tools for different needs!&lt;p&gt;I appreciate this, as looking for better tools in embedded space is welcome.  Just pity that so many of them come with so many dependencies and large library sizes.</text></item><item><author>Voultapher</author><text>Author here, I&amp;#x27;ve spent the last 1.5ish years researching sort implementations. While developing a test suite and understanding prior art, I&amp;#x27;ve accumulated a list of results and properties I thought would be insightful to share. Feel free to ask me questions.</text></item></parent_chain><comment><author>m00x</author><text>It actually does. You can modify Rust to run without stdlib, reducing its size significantly. There are also tons of tricks to make this work really well so it&amp;#x27;s very close to C performance.&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;esp-rs.github.io&amp;#x2F;book&amp;#x2F;&quot; rel=&quot;nofollow noreferrer&quot;&gt;https:&amp;#x2F;&amp;#x2F;esp-rs.github.io&amp;#x2F;book&amp;#x2F;&lt;/a&gt;
&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;avr-rust&amp;#x2F;ruduino&quot;&gt;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;avr-rust&amp;#x2F;ruduino&lt;/a&gt;</text></comment>
<story><title>Safety vs. Performance. A case study of C, C++ and Rust sort implementations</title><url>https://github.com/Voultapher/sort-research-rs/blob/main/writeup/sort_safety/text.md</url></story><parent_chain><item><author>teunispeters</author><text>Glad to C doing so well at what it&amp;#x27;s best at - efficiency and size.
I worked in embedded space for years.  Rust does not suit that environment.&lt;p&gt;Different tools for different needs!&lt;p&gt;I appreciate this, as looking for better tools in embedded space is welcome.  Just pity that so many of them come with so many dependencies and large library sizes.</text></item><item><author>Voultapher</author><text>Author here, I&amp;#x27;ve spent the last 1.5ish years researching sort implementations. While developing a test suite and understanding prior art, I&amp;#x27;ve accumulated a list of results and properties I thought would be insightful to share. Feel free to ask me questions.</text></item></parent_chain><comment><author>Voultapher</author><text>There are many situations where C libraries are amazingly small. This however is not one of those cases. ipnsort is aggressively optimized for binary-size. A sort instantiation for u64 is ~4.5k while crumsort was ~53k last time I measured.&lt;p&gt;I know several easy ways to boost ipnsort&amp;#x27;s performance by 10% but don&amp;#x27;t because they don&amp;#x27;t align with my binary-size and compile-time goals.</text></comment>