467,207 Members | 1,277 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,207 developers. It's quick & easy.

very poor performance in visual studio 2005

Bob
Hi,
I have a fairly large but not massive project. Visual Studio 2005 is
starting to act very strange when I debug the project. For instance,
if i set a break point, I often can't expand an array to see the
contents. Instead, it will say "function evaluation timed out".
Also, it takes a very long time to start and stop debugging, and
sometimes it won't restart after I pause execution. I don't seem to
have nearly as many problems in smaller projects. Does anyone have
any suggestions on how to improve this performance?

Thanks,
Bob

Jul 17 '07 #1
  • viewed: 6162
Share:
6 Replies
On Mon, 16 Jul 2007 19:06:57 -0700, Bob <bs********@yahoo.comwrote:
[...] For instance,
if i set a break point, I often can't expand an array to see the
contents. Instead, it will say "function evaluation timed out".
Also, it takes a very long time to start and stop debugging, and
sometimes it won't restart after I pause execution. I don't seem to
have nearly as many problems in smaller projects. Does anyone have
any suggestions on how to improve this performance?
I would guess that it has less to do with the size of the project and more
to do with how some particular class in that project that you're debugging
works. Maybe the type of class that's stored in that array, for example.

In particular, VS will by default try to evaluate properties, regardless
of how complicated they are. Sometimes this can run into trouble, if the
property does something beyond just returning the value of some private
field.

As a quick test, you can turn the property evaluate off to see if that
helps. If it does, then you may be able to track down exactly which
property or properties are problematic and hide them from the debugger
with an appropriate attribute applied to the property.

Pete
Jul 17 '07 #2
Bob
On Jul 16, 9:18 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Mon, 16 Jul 2007 19:06:57 -0700, Bob <bshumsk...@yahoo.comwrote:
[...] For instance,
if i set a break point, I often can't expand an array to see the
contents. Instead, it will say "function evaluation timed out".
Also, it takes a very long time to start and stop debugging, and
sometimes it won't restart after I pause execution. I don't seem to
have nearly as many problems in smaller projects. Does anyone have
any suggestions on how to improve this performance?

I would guess that it has less to do with the size of the project and more
to do with how some particular class in that project that you're debugging
works. Maybe the type of class that's stored in that array, for example.

In particular, VS will by default try to evaluate properties, regardless
of how complicated they are. Sometimes this can run into trouble, if the
property does something beyond just returning the value of some private
field.

As a quick test, you can turn the property evaluate off to see if that
helps. If it does, then you may be able to track down exactly which
property or properties are problematic and hide them from the debugger
with an appropriate attribute applied to the property.

Pete
Hi Pete,

Thanks for your quick response. I don't think it is a matter of a
complicated class, because I get the same problem even with primitive
collections. For instance, I added the following code to the very
beginning of the project:

List<Stringwhy = new List<string>();
for (int i=0;i<300;i++){
why.Add("Why doesn't this show" + i);

}
Debug.Print("breakpoint here");

If I breakpoint on the Debug.Print line and try to expand the "why"
list, it hangs for like 10 seconds, then gives me nothing. Later, it
sometimes give me "Function evaluation disabled because a previous
function evaluation timed out. You must continue execution to
reenable function evaluation." It also takes a very long time to start
and stop the project. Any ideas?

Jul 17 '07 #3
On Tue, 17 Jul 2007 01:02:50 -0700, Bob <bs********@yahoo.comwrote:
[...]
List<Stringwhy = new List<string>();
for (int i=0;i<300;i++){
why.Add("Why doesn't this show" + i);

}
Debug.Print("breakpoint here");

If I breakpoint on the Debug.Print line and try to expand the "why"
list, it hangs for like 10 seconds, then gives me nothing. Later, it
sometimes give me "Function evaluation disabled because a previous
function evaluation timed out. You must continue execution to
reenable function evaluation." It also takes a very long time to start
and stop the project. Any ideas?
Nope, sorry. Start ripping things out of your project until it works
again.

Can you reproduce the problem in a brand new empty project, to which
you've only added the above?

If not, then I stand by my assertion that you've got something in your
project that's causing the problem. What that might be, I don't know off
the top of my head. Make sure you don't have things displayed in your
memory, watch, etc. windows that are being auto-evaluated when you break
in the debugger to check the above code. Then start removing things from
your project until you remove something that fixes the problem.

Somewhere, it seems that the debugger is trying to evaluate a function.
Since telling it to do so explicitly isn't part of your "repro steps",
obviously it is trying to do so as a result of some implicit evaluation.
When you find that implicit evaluation, you'll know what's going wrong.

Pete
Jul 17 '07 #4
Bob
On Jul 17, 3:02 am, Bob <bshumsk...@yahoo.comwrote:
On Jul 16, 9:18 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Mon, 16 Jul 2007 19:06:57 -0700, Bob <bshumsk...@yahoo.comwrote:
[...] For instance,
if i set a break point, I often can't expand an array to see the
contents. Instead, it will say "function evaluation timed out".
Also, it takes a very long time to start and stop debugging, and
sometimes it won't restart after I pause execution. I don't seem to
have nearly as many problems in smaller projects. Does anyone have
any suggestions on how to improve this performance?
I would guess that it has less to do with the size of the project and more
to do with how some particular class in that project that you're debugging
works. Maybe the type of class that's stored in that array, for example.
In particular, VS will by default try to evaluate properties, regardless
of how complicated they are. Sometimes this can run into trouble, if the
property does something beyond just returning the value of some private
field.
As a quick test, you can turn the property evaluate off to see if that
helps. If it does, then you may be able to track down exactly which
property or properties are problematic and hide them from the debugger
with an appropriate attribute applied to the property.
Pete

Hi Pete,

Thanks for your quick response. I don't think it is a matter of a
complicated class, because I get the same problem even with primitive
collections. For instance, I added the following code to the very
beginning of the project:

List<Stringwhy = new List<string>();
for (int i=0;i<300;i++){
why.Add("Why doesn't this show" + i);

}
Debug.Print("breakpoint here");

If I breakpoint on the Debug.Print line and try to expand the "why"
list, it hangs for like 10 seconds, then gives me nothing. Later, it
sometimes give me "Function evaluation disabled because a previous
function evaluation timed out. You must continue execution to
reenable function evaluation." It also takes a very long time to start
and stop the project. Any ideas?
I hope I am not speaking prematurely but I think I may have solved my
problem. I deleted all breakpoints (the option is in the debug menu
in Visual Studio) and the performance improved immensely.

Jul 18 '07 #5
Bob wrote:
On Jul 17, 3:02 am, Bob <bshumsk...@yahoo.comwrote:
On Jul 16, 9:18 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Mon, 16 Jul 2007 19:06:57 -0700, Bob <bshumsk...@yahoo.com>
wrote:
[...] For instance,
if i set a break point, I often can't expand an array to see the
contents. Instead, it will say "function evaluation timed out".
Also, it takes a very long time to start and stop debugging, and
sometimes it won't restart after I pause execution. I don't
seem to have nearly as many problems in smaller projects. Does
anyone have any suggestions on how to improve this performance?
I would guess that it has less to do with the size of the project
and more to do with how some particular class in that project
that you're debugging works. Maybe the type of class that's
stored in that array, for example.
In particular, VS will by default try to evaluate properties,
regardless of how complicated they are. Sometimes this can run
into trouble, if the property does something beyond just
returning the value of some private field.
As a quick test, you can turn the property evaluate off to see if
that helps. If it does, then you may be able to track down
exactly which property or properties are problematic and hide
them from the debugger with an appropriate attribute applied to
the property.
Pete
Hi Pete,

Thanks for your quick response. I don't think it is a matter of a
complicated class, because I get the same problem even with
primitive collections. For instance, I added the following code to
the very beginning of the project:

List<Stringwhy = new List<string>();
for (int i=0;i<300;i++){
why.Add("Why doesn't this show" + i);

}
Debug.Print("breakpoint here");

If I breakpoint on the Debug.Print line and try to expand the "why"
list, it hangs for like 10 seconds, then gives me nothing. Later,
it sometimes give me "Function evaluation disabled because a
previous function evaluation timed out. You must continue
execution to reenable function evaluation." It also takes a very
long time to start and stop the project. Any ideas?

I hope I am not speaking prematurely but I think I may have solved my
problem. I deleted all breakpoints (the option is in the debug menu
in Visual Studio) and the performance improved immensely.
Rule of thumb: if you have a breakpoint which has a conditional rule
(e.g. break when this.foo == 42 ), the performance is very slow.
cntrl-shift-f9 is your friend :)

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Jul 18 '07 #6
Bob
On Jul 17, 12:31 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Tue, 17 Jul 2007 01:02:50 -0700, Bob <bshumsk...@yahoo.comwrote:
[...]
List<Stringwhy = new List<string>();
for (int i=0;i<300;i++){
why.Add("Why doesn't this show" + i);
}
Debug.Print("breakpoint here");
If I breakpoint on the Debug.Print line and try to expand the "why"
list, it hangs for like 10 seconds, then gives me nothing. Later, it
sometimes give me "Function evaluation disabled because a previous
function evaluation timed out. You must continue execution to
reenable function evaluation." It also takes a very long time to start
and stop the project. Any ideas?

Nope, sorry. Start ripping things out of your project until it works
again.

Can you reproduce the problem in a brand new empty project, to which
you've only added the above?

If not, then I stand by my assertion that you've got something in your
project that's causing the problem. What that might be, I don't know off
the top of my head. Make sure you don't have things displayed in your
memory, watch, etc. windows that are being auto-evaluated when you break
in the debugger to check the above code. Then start removing things from
your project until you remove something that fixes the problem.

Somewhere, it seems that the debugger is trying to evaluate a function.
Since telling it to do so explicitly isn't part of your "repro steps",
obviously it is trying to do so as a result of some implicit evaluation.
When you find that implicit evaluation, you'll know what's going wrong.

Pete
Hi Pete,
Thanks again for your suggestions. I am pretty sure I figured it
out. I had a bunch of disabled breakpoints which apparently slow
things down dramatically. I deleted all breakpoints in the debug menu
and it seems to have resolved the issues.

Thanks,
Bob

Jul 18 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by John A. Bailo | last post: by
8 posts views Thread by WT | last post: by
26 posts views Thread by Bill@msn.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.