What to do when the release version works but the debug version doesn't?

With a vanilla oF project, I’m using the ofxCsv addon to load a large csv file. It’s a matrix of numbers that is 1800x1800 – the file itself is only 6.5 megs, though. For the actual use case, the files may be quite a bit larger than this.

Here’s the thing – when I build a release executable, it loads the file without a problem and prints the expected output to the console. When I try to run a debug executable, the csv file never loads – it hangs while trying to load it.

Any suggestions on how to proceed?

it’s possible that it’s just taking way longer to load, debug mode is slower depending on the task like doing memory accesses it can be really slow compared to release so it’s possible that is just that

You should run the program step by step (using the debugger of your IDE) to see where it hangs. A good technique is to step over until the stuff hangs, then restart the program, and step into the function that hanged to see where’s the problem, and so on (if you reach system libs, you’ve probably been too deep in the call stack). This way you can see if it’s like a loop that takes ages to run, a system call that fails or something along those lines.

Arturo’s advice is relevant too, a first try would just be to check facebook for a few minutes while your stuff is crunching the numbers and see what’s happening then.

Alright. I’ll try again and distract myself to see if it loads. In release, it loads the file in under a second, which is what makes it strange.

You were correct! I loads in release in about 1 second but took about 10 minutes to load in debug. Thanks! I’ll try not to be so impatient. :slight_smile:

wow, that’s awfully slow, but yes specially visual studio can be really slow on debug