建立时间 [英] Build Time

查看:95
本文介绍了建立时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个库文件"EMD_Data.lib"它包含大量的原始数据(结构数组,每个结构有74个所有数据类型的成员,数组大约有4000个元素)。 我有一些主项目#include其标题
并链接到该库文件。


在VS2008中,编译Win-32大约需要55分钟和x64版本。 这不是问题,因为我只需要很少重建该文件,大约每年一次。 主要项目在大约
分钟内编译(甚至重建所有)。


我的.lib和.dll文件的项目设置是"No whole program optimization"。并且C / C ++优化被设置为"整个程序优化"。 - > NO。 对于.dll文件,链接器优化用于"链接时间代码生成"。是
设置为"默认"。


我刚将我的文件迁移到VS2010并保持相同的设置。


。 lib文件大约需要40分钟,.dll文件大约需要30分钟。  .dll文件是我一直在工作的程序(比如每周一次),所以当我需要花费很长时间来构建应用程序每隔
时间我想要测试一个新例程或者改善旧的。


我的技能水平介于初学者和中级之间,所以如果这是一个愚蠢的问题我很抱歉,但任何建议都会非常感激。


谢谢,


Ed



解决方案

您好EMD1954,


据我所知, / MP 编译器选项可以显着减少构建编译许多文件的时间。右键单击解决方案资源管理器中的项目 - >属性 - >配置属性 - > C / C ++ - >一般 - >多处理器复杂化,
并选择是(/ MP)。然后尝试重建解决方案。


如果您对构建时间仍不满意,可以增加并行项目构建的最大数量。单击"工具",然后在Visual Studio的主菜单中选择"选项"。转到项目和解决方案 - >构建和运行。您可以根据需要更改
numer,例如3和4.


我希望此回复对您有所帮助。如果您有任何疑问,请随时告诉我。


祝你好运, 


I have a library file "EMD_Data.lib" that contains a significant amount of raw data (an array of structs, each struct has 74 members of all data types, and the array is about 4000 elements).  I have a handful of main projects that #include its header and link to that library file.

In VS2008, it used to take about 55 minutes to compile the Win-32 and x64 versions.  This wasn't a problem because I only need to rebuild that file very infrequently, about once a year.  The main projects compiled (even rebuild all) in about a minute.

My project settings for both the .lib and the .dll files were "No whole program optimization" and the C/C++ optimization was set to "Whole program Optimization" -> NO.  For the .dll files, the Linker optimization for "Link Time Code Generation" was set to "Default".

I just migrated my files to VS2010 and I maintain the same settings.

The .lib file takes about 40 minutes and the .dll files each take about 30 minutes.  The .dll files are programs on which I am always working (say once a week) so I can't possibly be productive when it takes this long to build the application every time I want to test out a new routine or improve on an old one.

My skill level is somewhere between beginner and intermediate so I apologize if this is a stupid question but any advice would be greatly appreciated.

Thanks,

Ed

解决方案

Hi EMD1954,

As far as I know, the /MP compiler option can significantly reduce build time when you compile many files. Right click project in Solution Explorer->Properties->Configuration Properties->C/C++->General->Multi-processor Complication, and choose Yes (/MP). Then try to rebuild the solution.

If you are still not satisfied with the build time, you can increase the maximum number of parallel project builds. Click Tools and select Options in the main menu of Visual Studio. Go to Projects and Solutions->Build and Run. You can change the numer as you want, for example, 3 and 4.

I hope this reply is helpful to you. If you have any questions, please feel free to let me know.
Best regards, 


这篇关于建立时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆