<p>The compile time for mlpack is very long compared to other libraries of the same size.  There are many reasons for this; Armadillo (which is basically header-only) is one; boost is another; the template metaprogramming inside of mlpack is yet another.  But there are some ways that we can reduce compile time.</p>

<ul>
<li>Some of the headers in <code>src/mlpack/core/prereqs.hpp</code> are not used in all parts of the project and can be removed (or in some cases, included only where they are necessary).</li>
<li>Where possible, we can move header files into .cpp files (so they are not included by everything).  Some examples here might be the boost math headers.</li>
<li>We may be able to use <code>extern template</code> definitions for some of the various parts mlpack provides, specifying to common types, e.g., <code>extern template AllkNN&lt;arma::mat, EuclideanDistance, KDTree&gt;</code> and then having that specialization declared in some .cpp file... or something like this.</li>
</ul>

<p>It'll be easy to check if you've reduced compile times when Travis builds a PR; right now Travis takes about 31 minutes for a complete build, and AppVeyor takes about 45 minutes.  I doubt we can get order-of-magnitude compile speedups or anything, but we can probably help out incrementally.</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/722">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFGp51iI2S0C5CWOb4jZxGy59-vMTks5qU-txgaJpZM4JKvWX">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFAy5SUT3CS_Jq2vByOEGlV4gvXP6ks5qU-txgaJpZM4JKvWX.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/722"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>