我刚开始使用Boost 1.36。这些库对于减少我正在处理的非托管C ++软件项目所需的代码量非常有用。

然而,当我尝试使用这些库时,我的编译时间增加了十倍。这几乎抵消了使用该库所带来的生产力提升。

我正在使用3GHz Intel双核,2GB内存和VS 2003。

我添加了一段代码。

#include "boost/numeric/ublas/matrix.hpp"   
#include "boost/numeric/ublas/vector.hpp"  
#include "boost/numeric/ublas/matrix_proxy.hpp"  

typedef ublas::bounded_matrix <long double,NUM_OF_COLUMNS,NUM_OF_CATEGORIES,ublas::row_major> Matrix;  
typedef ublas::bounded_vector <long double,NUM_OF_COLUMNS> Vector;  

<代码> void Print(const Matrix&amp; amount)
{

<代码>
Vector total;

total.clear();
for (int category = 0; category < NUM_OF_CATEGORIES; category++)
{
    PrintLine(ublas::row(amount, category));
    total += ublas::row(amount, category);
}

PrintLine(total);   

<代码>}

VS 2003有问题吗?
我知道VS 2008更快,但升级将是一个艰难的卖点 是不是Boost针对快速运行时间进行了优化而不是快速编译?
我是否只是以次优的方式使用Boost Library?
或者我只是使用错误的工具来完成工作?

有帮助吗?

解决方案

您是否尝试过使用预编译的标头?这包括StdAfx.h中的boost标头或用于预编译头的任何头文件?

其他提示

您是否尝试过 Incredibuild ?它允许您在多台计算机上分发构建。我已经看到它成功使用了。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top