[mlpack-git] [mlpack/mlpack] Reduce compile time by removing unnecessary headers (#722)

Ryan Curtin notifications at github.com
Tue Jul 12 15:30:57 EDT 2016


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.

 * Some of the headers in `src/mlpack/core/prereqs.hpp` are not used in all parts of the project and can be removed (or in some cases, included only where they are necessary).
 * 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.
 * We may be able to use `extern template` definitions for some of the various parts mlpack provides, specifying to common types, e.g., `extern template AllkNN<arma::mat, EuclideanDistance, KDTree>` and then having that specialization declared in some .cpp file... or something like this.

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.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/722
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160712/f5aeb383/attachment.html>


More information about the mlpack-git mailing list