重命名VS项目性能问题 [英] rename VS project performance issue

查看:112
本文介绍了重命名VS项目性能问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近遇到过以下问题:



我有一个基于VS C ++ MFC的解决方案,我们将其命名为Solution0。它包含两个项目(Project0,Project1)。我需要创建一个新的解决方案,最初除了名称之外,所有内容都与原始解决方案相同。所以我将Solution0重命名为Solution1,Project0重命名为Project01,Project1重命名为Project11 - 使用Visual Studio的GUI及其重命名功能。



然后我有以下代码片段:



I've recently experienced the following issue :

I have a VS C++ MFC based solution, let's name it Solution0. It contains two projects ( Project0, Project1 ). I need to create a new solution out of it, initially having everything the same as the original one except names. So I rename Solution0 to Solution1 and Project0 to Project01, Project1 to Project11 - using Visual Studio's GUI and its Rename functionality.

Then I have the following code snippet :

struct Pos3d
{
  Pos3d() { x = y = z = 0; }
  DFloat     x, y, z;
};

Pos3d ** pos = new Pos3d*[ 361434 ];

  INT_PTR i;
  for( i = 0; i < 361434; i++ )
    pos[ i ] = new Pos3d();

  for( i = 0; i < 361434; i++ )
    ::delete pos[ i ];

delete pos;





在原始Solution0中,代码立即执行。在重命名的那个中,执行删除需要10秒钟。



任何想法可能是这种有趣行为的原因?



In the original Solution0 the code executes in an instant. In the renamed one it takes something like 10 seconds to perform the deletes.

Any idea what could be a reason of such funny behavior ?

推荐答案

他们没有理由这样做。你还应该重命名temp和bin等目录,然后运行一个全部重建,并且一切都应该没问题。
Their is no reason for that. You should also rename the pathes such as temp and bin directory and than run an "Rebuild all" and than all should be fine.


好的,事情就是这样:exe的名字很重要当然,当我更改项目名称时它已被更改。



和exe名称的链接是注册表项



HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft \ Windows NT \ CurrentVersion \图像文件执行选项\ your_exe_file_name.exe



如果密钥存在(甚至为空),VisualStudio调试器中的删除速度很快。如果没有,删除很慢。



我不知道为什么会这样,似乎没有任何关于它的任何体面的文档但是这是怎么回事它是。
OK, the thing is this : the name of the exe is important. Of course it has been changed when I had changed the project name.

And the link to the exe name is the registry key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\your_exe_file_name.exe

If the key exists ( even empty ), the deletes in the VisualStudio debugger are fast. If it does not, deletes are slow.

I don't know why it is so, there does not seem to be any decent documentation about it anywhere but that's how it is.


这篇关于重命名VS项目性能问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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