Re: Execution time debug vs. release
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Wed, 30 Aug 2006 18:00:52 -0400
Yeah, that sounds about right. Depends what it is doing, but this kind of slowdown should
not be surprising. In one case someone complained that he could only add about 5000
elements per second to his array. In release mode, with a trick of using nGrowBy, I was
able to add about 12,000,000/sec.
Note that VS is doing more and more runtime checks in debug mode, so it wouldn't surprise
me if VS8 did even more.
You could check this out by compiling just one of your files in VS7 and VS8 with the
listing options set to generate source+assembly and see if there is a substantial
difference.
The 100% CPU utilization is what I would expect to see.
You might get performance improvement by turning off various runtime checks. While it
will defeat error checking, judicious use of these may give you a balance between runtime
checking and performance.
joe
On Wed, 30 Aug 2006 15:09:45 -0400, r norman <r_s_norman@xxxxxxxxxxxx> wrote:
I have an MFC application in which executing a particular menu optionJoseph M. Newcomer [MVP]
takes a fraction of a second (estimated about 1/5 sec) in release mode
but when compiled in debug mode takes almost 40 seconds with 100% CPU
time. The process involves opening a dialog and filling some
controls, though there is a complex process of accessing a variety of
classes and using their methods to search through lists to gather and
prepare the data to display.
The application is compiled using Visual Studio 2005 (C++ 8.0). An
earlier version of the application, although with identical code in
this particular portion which was compiled using Visual C++ 7.0 runs
in a fraction of a second for both debug and release versions.
Is there a special reason why C++ 8.0 runs so incredibly slowly in the
debug version? This is not a problem for the final application, but
it is a serious problem for program design. Another application that
must form 15 TCP/IP socket connections to external devices runs so
slowly in debug version (>80% CPU time constantly) that there are
serious problems processing data, In release version it runs full
speed with Task Manager showing 0% CPU time.
I do have a number of ASSERT statements, but these mostly just check
whether a pointer is zero and I don't include any explicit calls to
debug routines like AssertValid or TRACE. What in the world could
take 38 seconds of 100% CPU time (1.73 GHz Pentium M, 1GB ram)?
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- Execution time debug vs. release
- From: r norman
- Execution time debug vs. release
- Prev by Date: Re: Hitting the Enter Key While in Edit Boxes..
- Next by Date: Re: how to make window resize smaller but not bigger?
- Previous by thread: Execution time debug vs. release
- Next by thread: Re: Execution time debug vs. release
- Index(es):
Relevant Pages
|