加快 ASP.NET 构建速度的方法

发布于 2024-10-22 22:45:30 字数 331 浏览 2 评论 0原文

当我构建 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

平定天下 2024-10-29 22:45:30

买更快的机器?听起来是个聪明的答案。我知道编译器可以利用多核机器。此外,在编译过程中会进行大量的硬盘驱动器访问,因此购买固态驱动器可能是有意义的。也许不是您正在寻找的答案,但这是一个明确的解决方案。

您可以做的另一件事是配置您的项目以允许“编辑并继续”。这将允许更改一些小事情并继续调试,而无需进行完全重新编译。

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.

属性 2024-10-29 22:45:30

以下是一些想法:

  • 禁用任何“实时”病毒/恶意软件防护,至少在此过程中。
  • 在此过程中禁用 VS 使用的文件夹的索引(Windows、Google 桌面等)。
  • 禁用/停止可能正在访问硬盘的其他进程。这里最大的问题是延迟 - 即使其他应用程序正在访问/写入小文件,访问时间也会影响速度。

正如最初的海报所建议的,最大的冲击将来自硬件:购买 SSD 和至少 4 核的处理器。如果你购买 4 个便宜的 64GB SSD 并将它们放入 RAID 0,你会对差异感到震惊,甚至发现你的 CPU 和 RAM 会突然成为瓶颈。

Here are a couple of thoughts:

  • Disable any "realtime" virus / malware protection, at least during this process.
  • Disable indexing (Windows, Google desktop, etc.) for the folders that VS uses during this process.
  • Disable / stop other processes that may be accessing the hard disk. The biggest issue here is latency - even if other applications are accessing / writing tiny files, it is the access time that kills speed.

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.

如梦初醒的夏天 2024-10-29 22:45:30

Suspend Resharper - 当您只是编码时,R# 会提供极大的帮助,但实际上会减慢编辑-编译-测试循环的速度。

Suspend Resharper - R# helps tremendously when you're just coding but really slows down the Edit-Compile-Test loop.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文