Boost logo

Ublas :

Subject: [ublas] How to speed up the compilation?
From: Peng Yu (pengyu.ut_at_[hidden])
Date: 2008-09-09 11:24:40


In the ublas doc, it says, "To achieve the goal of efficiency for
numerical computing, one has to overcome two difficulties in
formulating abstractions with C++, namely temporaries and virtual
function calls. Expression templates solve these problems, but tend to
slow down compilation times."

I'm wondering if it is possible to have two versions of libraries, one
is with virtual functions the other is not. When I'm developing code,
I want fast compilation, so I can use the virtual function based one.
When I want run the program as fast as possible, I use the templated
one. If the switching between modes is very easy, the slow compilation
is not problem, because users can always use the virtual function
based one and later use the templated library for fast runtime.

This is question is applicable in general to any library that use
template extensively. I'm wondering if there is a solution to it.