xbmc/xbmc — pull request #1009 by jmarshallnz (2012-05-25 01:07:08+00:00)
Title: Win32 drop iterator debugging

Win32 STL under debug is extraordinarily slow. Essentially this is due to a global lock being used for iterator checking.

With AE being added, SoftAE::Run() runs a tight loop which creates an empty vector and iterates over an empty vector, even if nothing is playing. Combined with vector access from the UI in general, this makes things run at a snails pace. On my machine (older core2duo) this meant around 8fps whilst sitting at the login screen for example.

The cause was traced to the creation of the vector and, in addition, to the creation of the iterators for the for loop in SoftAE::RunStreamStage(). The first commit reduces this by checking for an empty vector first.

The second 2 commits turn off the checking/debugging of iterators under debug (i.e. it's similar to how it behaves under release). I don't recall ever getting anything of use out of this debugging facility, so it seems pointless to keep it in when things run much snappier with it out. The problem is it's all in or all out: All projects need building with the magic defines set to 0.

Thus, tinyxml in particular needs to be rebuilt (commit 3). I don't have access to the mirrors to my knowledge, but it's pretty simple. The readme in the archive needs to be changed to:

- get sources from here http://sourceforge.net/projects/tinyxml/
- modify the tinyxmlSTL project (debug target) and add these to the preprocessor definitions

_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0;

- compile tinyxmlSTL as debug and release lib.

@elupus I know you've hit this before. @wsoltys, @chadoe, @DDDamian + anyone else on win32 - please chime in.