Boost C++ Libraries: Ticket #11458: Performance improvement in boost/math.quaternion.hpp https://svn.boost.org/trac10/ticket/11458 <p> Quaternion makes use of <code>std::valarray</code> to make some trivial math operations take fewer LOC to implemen. <code>valarray</code> always mallocs, even for a small number of values, in this case 2 or 4. This has a huge performance impact on quaternion division. In an model I am working on, replacing the use of <code>valarray</code> with a normal stack array resulted in a 32% performance improvement. As the changes are not hard to implement and rely on no special libraries, I believe that the boost library can benefit from these changes. </p> <p> I've attached a modified header to this that should fix the issue, but do not have time or resources to fully test it for boost inclusion. I've done my best to emulate your style, but I assume someone will want things done slightly differently. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11458 Trac 1.4.3 Scott Macintire <scott.macintire@…> Thu, 09 Jul 2015 15:58:57 GMT attachment set https://svn.boost.org/trac10/ticket/11458 https://svn.boost.org/trac10/ticket/11458 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">quaternion.hpp</span> </li> </ul> <p> editted header </p> Ticket gast128@… Mon, 11 Apr 2016 13:03:34 GMT <link>https://svn.boost.org/trac10/ticket/11458#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11458#comment:1</guid> <description> <p> Although this issue is about the heap alloc, it seems that Intel has made a valarrray using SIMD instructions. That could be the next improvement: </p> <p> <a class="ext-link" href="https://software.intel.com/en-us/node/514490"><span class="icon">​</span>https://software.intel.com/en-us/node/514490</a>. </p> <p> Perhaps a valarray with static sizes could in itself be a good addition to Boost (in Boost.Container, but this probably this spawns a heated modularization discussion). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Tue, 31 Jul 2018 17:37:21 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11458#comment:2 https://svn.boost.org/trac10/ticket/11458#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">obsolete</span> </li> </ul> <p> Current version no longer uses valarray. </p> Ticket