From: Dean M. B. <mik...@gm...> - 2010-10-26 05:54:04
|
In the same line as my previous message, I have made a simple step that also greatly reduces compile times now with the tag dispatch mechanism. With my recent change: http://goo.gl/4A5I I was able to reduce the compile time of the tests with just using a simple technique for compile-time "type erasure" to avoid the excessive template instantiations throughout the library with regards to tags. In the commit message I explain what I did and how it affects compile times immensely. I'm copying the commit message here for posterity and feedback: --8<--- Compile-time Reduction Techniques This commit hilights the effect of hiding the MPL details into the base class instead of a typedef. Instead of just a typedef, use Boost.MPL metafunctions as base classes. i.e. instead of: typedef typename mpl::inherit_linearly<...>::type tag_name; Do this instead: struct tag_name : mpl::inherit_linearly<...>::type {}; This then makes the tag back into an opaque type that the compiler doesn't have to keep instantiating over and over again in the cases where the tag is used. Also because all the metafunctions deal with opaque tags and whether they inherit from specific root/base tags, then the compile times are greatly reduced. You can call this type erasure at compile-time using OOP facilities. --8<--- Let me know if this helps, if anybody can measure the difference between 0.7 and the latest in 0.8-devel, that would greatly be appreciated as well. :) Have a good one guys! -- Dean Michael Berris deanberris.com |