加快 ASP.NET 构建速度的方法
当我构建 Web 项目时,编译大约需要 20 秒。然后,当我尝试浏览项目中的网页时,asp.net 会进行运行时编译(另外 20 秒)。我知道我无法逃避这些步骤,因为这就是 ASP.NET 的工作原理,只是想看看是否有人有某种优化来使这些构建更快。
尝试改进我的编辑-编译-测试循环
我的机器详细信息:
-Intel Core i7 处理器@2.80GHz
-8GB 内存
-高清 @ 7200 RPM
When I'm building my web project it takes about 20 seconds to compile. Then when I try to browse to a web page in project, asp.net does its runtime compilation(another 20 seconds). I know I can't escape these steps because thats how asp.net works, just want to see if anyone has some kind of optimization to make these builds faster.
Trying to improve my Edit-Compile-Test loop
My machine details:
-Intel Core i7 processor @2.80GHz
-8GB of RAM
-HD @ 7200 RPM
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
买更快的机器?听起来是个聪明的答案。我知道编译器可以利用多核机器。此外,在编译过程中会进行大量的硬盘驱动器访问,因此购买固态驱动器可能是有意义的。也许不是您正在寻找的答案,但这是一个明确的解决方案。
您可以做的另一件事是配置您的项目以允许“编辑并继续”。这将允许更改一些小事情并继续调试,而无需进行完全重新编译。
Buy a faster machine? Sounds like a smart answer. I know that the compiler can take advantage of multi core machines. Also, during compilation there's a lot of Hard drive access, so it may make sense to get a solid state drive. Maybe not the answer you are looking for, but it's a definite solution.
The other thing you can do is configure your project to allow for "Edit And Continue". This will allow for small things to be change, and continue debugging, without doing a full recompile.
以下是一些想法:
正如最初的海报所建议的,最大的冲击将来自硬件:购买 SSD 和至少 4 核的处理器。如果你购买 4 个便宜的 64GB SSD 并将它们放入 RAID 0,你会对差异感到震惊,甚至发现你的 CPU 和 RAM 会突然成为瓶颈。
Here are a couple of thoughts:
As the original poster suggested, your biggest bang will come from hardware: get an SSD and a processor with at least 4 cores. If you were to buy 4 cheap 64GB SSD's and put them in RAID 0, you would be shocked at the difference and even discover that your CPU and RAM will suddenly become bottlenecks.
将您的代码移至 RAMDisk 上,或购买 SSD 驱动器。
Move your code onto a RAMDisk, or buy an SSD drive.
Suspend Resharper - 当您只是编码时,R# 会提供极大的帮助,但实际上会减慢编辑-编译-测试循环的速度。
Suspend Resharper - R# helps tremendously when you're just coding but really slows down the Edit-Compile-Test loop.