http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gameprogrammer] Re: std::string alternative



> >> Dave Slutzkin wrote:
> >>
> >>> So turn 'em off and keep using std::string?  If you're not checking 
> >>> them anyway then there's zero difference in functionality.

On Sun, 20 May 2007 22:07:55 -0700, "Kevin Jenkins"
<gameprogrammer@rakkar.org> said:
> Like I originally said, every function call is slower.  I don't have 
> the URL (maybe someone can find it) but if you read the Halo 2 
> postmortem they got a 5% speed increase by turning off exceptions.

To reiterate, if you turn them off in the compiler flags then the
compiler shouldn't consider them or use them - no extra code should be
generated regardless of whether std::string uses them.  This saves you
changing libraries at the cost of changing compiler flags.

At least, this works with gcc - I'm not sure about Visual C++.  With g++
I can use std::string even when passing in -fno-exceptions, though I
can't write a throw statement in my own code:

"exception handling disabled, use -fexceptions to enable"

Because the standard libraries are written so that trys and throws
become no-ops when exceptions are disabled.  I would assume that such
would be the case on Visual C++ as well.

Didn't you say in your blog that you'd already turned exceptions off,
Kevin?  If it compiled the code then what's the problem?  How do you
know you've got exception overhead even when they're turned off?

Dave.
-- 
  Dave Slutzkin
  Melbourne, Australia
  daveslutzkin@fastmail.fm


---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html