visual-studio 为什么 Visual Studio 2005 这么慢?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43524/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why is Visual Studio 2005 so slow?
提问by Nick
It is slow to load anything other than a small project. It is slow to quit; it can sometimes take minutes. It can be slow to open new files. The record macro feature used to be useful. It is now so slow to start up it's almost always quicker to do it manually!
加载小项目以外的任何东西都很慢。戒烟很慢;有时可能需要几分钟。打开新文件可能会很慢。记录宏功能曾经很有用。现在启动太慢了,手动启动几乎总是更快!
More info would be helpful. How big are your solutions? What platform are you on. What 3rd party plugins are you running? What else is running on your pc?
更多信息会有所帮助。你的解决方案有多大?你在什么平台。您正在运行哪些 3rd 方插件?你的电脑上还有什么正在运行?
3.2GHz P4 Hyperthreaded, 2GB RAM. Running Outlook, Perforce, IE7, directory browsers. Usually have 1-3 instances of VS running. It's much slower than VC6, say. It seems to take a long time to load projects and close down. I'm interested in if people know reasons why this happens, because of the way VS is written. Is it using .net internally and GC slows it down?
3.2GHz P4 超线程,2GB RAM。运行 Outlook、Perforce、IE7、目录浏览器。通常有 1-3 个 VS 实例在运行。例如,它比 VC6 慢得多。加载项目和关闭似乎需要很长时间。我感兴趣的是人们是否知道为什么会发生这种情况,因为 VS 的编写方式。它是否在内部使用 .net 而 GC 会减慢它的速度?
回答by Karim
One of the biggest culprits for Visual Studio 2005 slowness is Intellisense. This has been brought up on the MSDN forums again and again and again. What I frequently experience is that Intellisense is working nearly non-stop to "re-index" symbols (or whatever you call it). But developers at Microsoft have not been deaf to the complaints and some outgoing folks there have come up with some workarounds that have helped me and might help you:
导致 Visual Studio 2005 缓慢的最大罪魁祸首之一是 Intellisense。这在 MSDN 论坛上一次又一次地被提出。我经常遇到的是,Intellisense 几乎不停地工作来“重新索引”符号(或任何你称之为的东西)。但是微软的开发人员并没有对这些抱怨充耳不闻,那里的一些外向的人提出了一些对我有帮助并且可能对你有帮助的解决方法:
Check out this link to get a better understanding of Intellisense:
查看此链接以更好地了解 Intellisense:
Then check out this link for some macros that I've had a lot of success with:
然后查看此链接以获取一些我已经取得很大成功的宏:
With those macros, you can turn off intellisense (without renaming any DLLs), restart it, delete the ncb file (which you can do manually, but this is a convenience) and it can give you the status of Intellisense.
使用这些宏,您可以关闭智能感知(无需重命名任何 DLL)、重新启动它、删除 ncb 文件(您可以手动执行此操作,但这很方便)并且它可以为您提供智能感知状态。
回答by Mark Harris
回答by Nick
One of the biggest culprits for Visual Studio 2005 slowness is Intellisense. This has been brought up on the MSDN forums again and again and again. What I frequently experience is that Intellisense is working nearly non-stop to "re-index" symbols [...]
导致 Visual Studio 2005 缓慢的最大罪魁祸首之一是 Intellisense。这在 MSDN 论坛上一次又一次地被提出。我经常遇到的是 Intellisense 几乎不停地工作以“重新索引”符号 [...]
I agree. I use Visual Assist. It is much better. There is no real way to turn "Intellisense" off either. The only way I have found is to rename the DLL so when you restart VS it is not found. This works and makes VS faster.
我同意。我使用视觉辅助。好多了。也没有真正的方法可以关闭“智能感知”。我发现的唯一方法是重命名 DLL,因此当您重新启动 VS 时找不到它。这有效并使VS更快。
回答by Nick
I'm am seeing mixed results with faster machines. Sure, faster machine, hides the poor performance quality of vs2005 but not all.
我看到使用更快的机器获得不同的结果。当然,更快的机器,隐藏了 vs2005 的糟糕性能质量,但不是全部。
Simply taking your obligatory "hello world" C/C++ program, just compile it, (CL /c helloword.cpp),
只需将您的强制性“hello world”C/C++ 程序编译,(CL /c helloword.cpp),
#include <stdio.h>
#include <windows.h>
int main(char argc, char *argv[])
{
printf("Hello World\n");
return 0;
}
I see 1 seconds compiler under Vc6 and a 6 seconds compile under VS2005.
我在 Vc6 下看到 1 秒编译器,在 VS2005 下看到 6 秒编译器。
Using DEPENDS to profile the two, I see 3 areas where the 5 seconds delays and time different are taking place:
使用 DEPENDS 来分析这两者,我看到 3 个区域发生了 5 秒延迟和时间差异:
~2.5 secs with ADVAPI32.DLL, CryptGetHashParam()
~1.5 secs with OLE2.DLL, StringFromGUID2()
~1.0 secs with C2.DLL, _AbortCompilerPass()
Again, this is just a compile, not a link. The VC8+ compiler executables/dlls are referencing sub-systems like crypto API, the Registry for some transparent reason and it is adding a tremendous amount of overhead to straight and pure compiles.
同样,这只是一个编译,而不是一个链接。VC8+ 编译器可执行文件/dll 正在引用子系统,如加密 API、注册表出于某种透明的原因,它为直接和纯编译增加了大量开销。
While a faster machine may hide some of hide slow down, one could only wonder if Microsoft can optimize the compiler by offering options that disables unnecessary overhead references. I understand the better compiler comes with some overhead, but what I see is a 300-500% compile time degradation - thats awful.
虽然更快的机器可能会隐藏一些隐藏的慢,但人们只能想知道 Microsoft 是否可以通过提供禁用不必要的开销引用的选项来优化编译器。我知道更好的编译器会带来一些开销,但我看到的是 300-500% 的编译时间降级 - 这太糟糕了。
Hector Santos, CTO Santronics Software
Hector Santos,CTO Santronics Software
回答by spoulson
I tend to agree that VS is a heavyweight. Back in the day I coded in DOS using Boxer text editor and makefiles. Boxer didn't have the heavy intellisense and refactoring features, but it did better in the text editing department, had good syntax highlighting and startup/closing were instantaneous, even on a 486. ...those were the days.
我倾向于同意 VS 是重量级的。回到过去,我使用 Boxer 文本编辑器和 makefile 在 DOS 中编码。Boxer 没有强大的智能感知和重构功能,但它在文本编辑部门做得更好,具有良好的语法突出显示和即时启动/关闭,即使在 486 上也是如此。......那些日子。
I would say it would be really nice to customize VS to remove all the overhead you're never going to use anyway, but I don't see that happening.
我会说定制 VS 以消除您永远不会使用的所有开销真的很好,但我没有看到这种情况发生。
回答by Nick
here's ya problem:
3.2GHz P4 Hyperthreaded, 2GB RAM
Hypertheaded means "doesn't actually have two CPU's, but it fakes it". If you have a process with just one thread running, then you get bad performance. It was a good short-term measure, but compared to having two REAL CPU's, it's a slow hack.
这是你的问题:
3.2GHz P4 超线程,2GB RAM
Hypertheaded 的意思是“实际上没有两个 CPU,但它是伪造的”。如果您的进程只运行一个线程,那么您的性能就会很差。这是一个很好的短期措施,但与拥有两个真正的 CPU 相比,这是一个缓慢的黑客攻击。
I don't think that's the problem at all. The machine is plenty high spec enough to be professional C++ development machine for large projects. I can run Eclipse (which is Java, which is memory hungry and slower than native code) and this is still way faster than VS 2005.
我认为这根本不是问题。该机器的规格足够高,足以成为大型项目的专业 C++ 开发机器。我可以运行 Eclipse(它是 Java,它需要内存并且比本机代码慢)并且这仍然比 VS 2005 快得多。
I doubled the amount of RAM from 1GB to 2GB. This helps a lot with linking large applications. We also use Incredibuild to accelerate compilation. But it's the VS app that is slow.
我将 RAM 量从 1GB 增加到 2GB。这对链接大型应用程序有很大帮助。我们还使用 Incredibuild 来加速编译。但它是缓慢的VS应用程序。
And if you think I'm a grumpy anti-MS zealot, ask yourself why people aren't buying Vista! :)
如果你认为我是一个脾气暴躁的反 MS 狂热者,问问自己为什么人们不购买 Vista!:)
回答by Jon Limjap
Recently I've had both Visual Studio 2008 and Visual Studio 2005 on my machine, and I agree that VS2005 is really heavy. They improved upon it in VS2008, although I'm not sure if you'll consider the performance improvements enough.
最近我的机器上同时安装了 Visual Studio 2008 和 Visual Studio 2005,我同意 VS2005 真的很重。他们在 VS2008 中对其进行了改进,但我不确定您是否会充分考虑性能改进。
回答by Niyaz
This is a purely subjective thing I am afraid.
这恐怕是纯粹主观的事情。
- May it is because of your low end system configuration.
- May be VS trying to get updates from the net?
- May be you are running too many application in the background.
- May be you are trying to open a huge solution.
- 可能是因为您的低端系统配置。
- 可能是 VS 试图从网上获取更新?
- 可能是您在后台运行了太多应用程序。
- 可能是您正在尝试打开一个巨大的解决方案。
回答by Andrew Bainbridge
VS 2005 is slower than VS 6 because it is less well optimized for speed. The developers of VS 6 had slower machines than the developers of VS 2005. They made it fast "enough" back then. On a modern machine VS is now "pleasantly fast", where VS 2005 is only just fast enough.
VS 2005 比 VS 6 慢,因为它在速度方面没有得到很好的优化。VS 6 的开发人员的机器比 VS 2005 的开发人员慢。当时他们让它“足够快”。在现代机器上,VS 现在“非常快”,而 VS 2005 只是足够快。
What annoys me is that they decided to scrap VS 6 and start again for VS 2005, when VS 6 was an awesome piece of software that just needed updating.
令我烦恼的是,他们决定放弃 VS 6 并重新开始使用 VS 2005,当时 VS 6 是一款非常棒的软件,只需要更新即可。
回答by Steve Sheldon
I noticed above you mentioned you are using perforcet too. Do projects load faster when not in perforce, I am willing to bet that some of the delay you are seeing is related to perforce during load. The latest version of perforce seems a lot slower too.
我注意到上面你提到你也在使用 perforcet。不使用 perforce 时,项目加载速度是否更快,我敢打赌,您看到的某些延迟与加载期间的 perforce 相关。最新版本的 perforce 似乎也慢了很多。

