Issue
The initial phase of my program loads in significant amounts of data into STL containers. I found that it was taking several minutes before I could reach the real meat of my program.
After some searching, I found that I could set _NO_DEBUG_HEAP==1 within my VS2012 Configuration Properties->Debugging->Environment variable...turning off utilization of the windows debug heap. This gave me a 10x improvement in debugging speed. I have not yet found any description what what debugging functionality I lose by doing so.
In summary: what checks were completed and what debug info was being generated by using the windows debug heap?
Thank you.
Solution
The debug heap impacts performance in two ways:
First, it adds checks to the heap integrity during heap operations. I haven't found details on these checks, but one assumes that on each allocation or free, it involves verifying the integrity of the data structures used to manage the heap.
Second, it disables the low-fragmentation heap (LFH) option. In a release build, you get LFH by default. In a debug build, you don't--unless you use the _NO_DEBUG_HEAP. This isn't necessarily a speed penalty, but it might be.
There are clues in the documentation for HeapSetInformation
.
Note that the C and C++ runtime libraries provide memory management built on top of the system heap APIs, and they also have debug and non-debug modes that can affect performance. There is more detailed documentation about what the debug CRT does. You might check and see if turning off the CRT debugging is enough to get you a significant boost in performance without messing with the debug mode of the process heap.
Answered By - Adrian McCarthy Answer Checked By - Robin (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.