C++ performance profiling of iterator implementation

Viewed 47

I'm doing some performance profiling of my code in Visual Studio 2022, and one part in my hot path is the construction of a const_iterator of my own implementation. I'm spending about 20% of my time there, but I can't see how to expand the profile to show me what is happening in the const_iterator class that is taking so long.

I've tried in both debug and release mode, with _ITERATOR_DEBUG_LEVEL set to 2 or 1. When running in debug, I never actually get out of the library code. In release I get to my own code. In all cases, I can never see what's going on in my iterator.

What am I doing wrong?

1 Answers

It sounds like you're not building debug symbols for your release mode binary. They're needed to bind the stack trace to your source code and get function names for function addresses.

You should also load debug symbols for the standard libraries. Check your Output window to see which DLLs have symbols loaded and which don't. Once properly set up (start by disabling Just My Code debugging), your executable, every DLL you own and every standard and system DLL should have symbols loaded. Your profile will be much more useful then.

Related