Automatically output the callstack on a breakpoint in Visual Studio

When you’re dealing with a large program and multiple developers, it’s not always obvious how and when certain things get executed. One of the very useful ways to debug unexpected behaviour is to set a breakpoint on a suspect line of code, and examine the callstack when it gets hit to see the execution path.

For infrequent events, it’s not always desirable to halt the entire program while you do that though. Instead, you can tell Visual Studio to write the callstack to the output when the breakpoint gets hit, and immediately continue execution.

Read more Automatically output the callstack on a breakpoint in Visual Studio

Improve C++ performance in debug mode with inline expansion

When you’re dealing with an intensive real-time application, such as a game or simulation, a common problem is that debug builds in C++ can run much slower than release builds. This difference in run-time behaviour means it can be hard to reproduce and analyse bugs and other problems. There are several things you can do to improve it, and one which helped me recently was enabling inline expansion (or simply “inlining”).

A quick warning though: it won’t improve performance in all situations, and it can actually hinder debugging. For performance-critical code, you should first try manually optimising your algorithms.

Read more Improve C++ performance in debug mode with inline expansion