I've recently encountered this same problem myself. My experiments show
that iterating over a vector with an iterator is ***TEN TIMES SLOWER***
than with iterator debugging disabled. In release builds!
Ideally I'd just define _SCL_SECURE to 0, but I can't as I'm dependent
on closed-source libraries without it defined and this has given me
weird crashes.
However, I've discovered that using std::for_each in place of a for loop
provides a massive speed up - it performs the same is if iterator
debugging were disabled.
So I'd like to replace the frequently run for loops in osg with a
std::for_each equivalent. This would be a major performance win for
Visual Studio users, and I assume it wouldn't hurt everyone else.
Before I do this I want to check will this be OK with you guys?
________________________________
From: [email protected]
[mailto:[email protected]] On Behalf Of Posch,
Stephan
Sent: 30 May 2008 22:33
To: [email protected]
Subject: [osg-users] Visual Studio, Iterator Debugging, Secure SCL,Slow
Performance, and getFileExtension "bug"
I've recently been working on upgrading code from VC7 to VC9, and have
run into all kinds of fun issues. The most significant problem/pain has
been the ridiculously slow debugging introduced when compiling with
iterator debugging (default behavior of VC8/VC9). I've waded through
that mess, getting OSG and the necessary dependencies compiled without
iterator debugging turned on (and without Secure SCL on), and my
debugging performance has returned to pre-VC8 performance. I did in the
meantime run across one slight problem. I've only caught it in one
place within OSG, but I'm sure it exists elsewhere in the code:
In any case, I kept getting a crash when executing the return statement
in the osgDB::getFileExtension() function. After much debugging and
research, I found that it seems there is a problem with the VC8/VC9
compiler described on the following page:
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?Fee
dbackID=319895
If you don't want to be bored by the details, it basically says that VC8
& VC9 have a bug when Iterator Debugging is turned off with regards to
iterator copying, and that Microsoft doesn't intend to address it until
VC10. In my specific case, that bug causes an assertion at the return
statement of getFileExtension().
This is not a bug in OSG, but it's definitely something to be on the
lookout for if you are turning iterator debugging off, whether it be in
OSG or any other STL-based code.
Has anyone else experienced this? Any thoughts? I have a clunky
work-around I'm using that works okay, but I hate clunky work arounds
:-)
Steve
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
______________________________________________________________________
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org