Thread: 2min in debug mode, 3sec in release!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User glUser3f's Avatar
    Join Date
    Aug 2003
    Posts
    345

    Unhappy 2min in debug mode, 3sec in release!

    I'm using VC++.NET 2003 version, I have a rather complex program that, in some point, uses 2 nested for loops like this:
    Code:
    for (int i = 0; i < 2000; i++) {
    	if ( /* some condition */ ) { continue; }
    	for (int j = 0; j < 2000; j++) {
    		if ( /* some condition */ ) { continue; }
    
    		if ( /* some condition */ ) {
    			// do something
    		}
    	}
    }
    I can't optimize it any further.

    The problem is that this loop takes around 2 minutes to finish on my 2.4 GHz P4!
    I used the debugger and made the sure that this loop is delaying the whole program, nothing else.
    I tried to find something wrong in the conditions or the processing but everything was OK, finally I decided to switch to release mode and voila, it take only 3 seconds!
    I'm using release mode right now, it work fine, however, I can't use the debugger any more
    Any ideas how to speed things up in debug mode? cuz I really need the debugger.
    thx
    Last edited by glUser3f; 10-01-2003 at 05:34 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 09-16-2006, 07:11 PM
  2. Results in Debug and Release mode are different
    By jaro in forum C Programming
    Replies: 11
    Last Post: 05-27-2006, 11:08 AM
  3. release vs debug mode
    By bithub in forum Tech Board
    Replies: 2
    Last Post: 05-10-2006, 03:31 PM
  4. Release vs. Debug mode builds
    By earth_angel in forum C++ Programming
    Replies: 5
    Last Post: 11-10-2005, 04:41 PM
  5. Debug Mode Vs. Release Mode
    By incognito in forum Tech Board
    Replies: 5
    Last Post: 12-18-2003, 04:06 PM