<p>I wrote a simple test. With <code>-O3</code> <code>std::pair</code> is faster then <code>SortStruct</code>.<br>
If <code>n=100M</code>:</p>

<pre><code>SortStruct results:
sorted[0].n = 26200464
fill duration = 1620ms
sort duration = 17090ms
std::pair results:
sorted[0].n = 26200464
fill duration = 1597ms
sort duration = 12287ms
</code></pre>

<p><a href="https://github.com/mlpack/mlpack/files/340894/main.cpp.zip">main.cpp.zip</a></p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/issues/712#issuecomment-229583356">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFOqU_C8o5vhyi0PVGTFhhKAL3VGRks5qQ3K_gaJpZM4JBmsJ">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFDYT7ZAsbD6uWHe1aQDs-lbRQokeks5qQ3K_gaJpZM4JBmsJ.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/issues/712#issuecomment-229583356"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>