简体   繁体   English

视觉工作室2015年建设需要很长时间

[英]visual studio 2015 build takes long time

I went from VS 2013 to VS 2015 and when I do a build it takes 90+ seconds or so. 我从VS 2013开始到VS 2015,当我进行构建时,它需要90多秒左右。

Is there anything I can do to speed that up? 有什么办法可以加快速度吗? (VS 2013 took about 10 seconds). (VS 2013花了大约10秒钟)。

Also, What is the cause? 另外,原因是什么? I do see it is running a couple extra things during build (I don't think 2013 did all these): 我确实看到它在构建过程中运行了一些额外的东西(我不认为2013年做了所有这些):

  • Starting .NET Native compilation 启动.NET Native编译
  • Processing application code 处理应用程序代码
  • Computing application closure and generating interop code 计算应用程序关闭并生成互操作代码
  • Compiling interop code 编译互操作代码
  • Generating serialization code 生成序列化代码
  • Cleaning up unreferenced code 清理未引用的代码
  • Running native compilers 运行本机编译器

.Net native will affect compilation speed. .Net native会影响编译速度。 The .Net Native FAQ discusses the compilation speed difference: .Net Native FAQ讨论了编译速度差异:

Compilation with .NET Native is slower than with MSIL. 使用.NET Native进行编译比使用MSIL慢。 Why? 为什么?

Normal app development uses the standard MSIL/JIT development experience in Visual Studio. 普通应用程序开发使用Visual Studio中的标准MSIL / JIT开发经验。 The .NET Native compiler isn't invoked until the application is deployed to the device, after most of the development process is finished and the focus shifts to optimizing the app. 在大部分开发过程完成并且焦点转移到优化应用程序之后,在将应用程序部署到设备之前,不会调用.NET Native编译器。 At this point, the compilation times are similar to optimized C++ with Link-Time Code Generation. 此时,编译时间类似于带有链接时代码生成的优化C ++。

By default Universal app debug builds (which you probably use most often during development) won't enable .Net Native. 默认情况下,通用应用程序调试版本(您可能在开发期间最常使用)将无法启用.Net Native。 Universal app release builds enable it since .Net Native is required for the store. 通用应用程序发布版本启用它,因为商店需要.Net Native。 You can disable it for release builds in the Project.Properties Build pane, but you probably shouldn't. 您可以在Project.Properties构建窗格中为发布版本禁用它,但您可能不应该这样做。 For production the runtime improvements are almost always worthwhile even if you're not deploying through the store, and for testing release mode you want to use the same optimizations that you'll release. 对于生产,即使您没有通过商店进行部署,运行时改进几乎总是值得的,并且对于测试发布模式,您希望使用您将要发布的相同优化。

在此输入图像描述

We have a webforms app. 我们有一个webforms应用程序。 50 pages or so, about 300,000 LOC and it was getting slow to compile (about 1 minute on our Surface Pro 4 16GB I7 machines). 50页左右,大约300,000 LOC,编译速度慢(在我们的Surface Pro 4 16GB I7机器上大约1分钟)。 We flipped the setting for the build to "Build Page" instead of "Build Website" so instead of compiling the whole site, only the page is compiled. 我们将构建的设置翻转为“构建页面”而不是“构建网站”,因此不是编译整个站点,而是仅编译页面。 This makes compiling very fast. 这使编译速度非常快。 Of course, you'll want to flip the setting back to "Build Website" before checking in or deploying. 当然,在签入或部署之前,您需要将设置翻转回“构建网站”。

财产页面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM