[gameprogrammer] Re: std::string alternative
- From: "Dave Slutzkin" <daveslutzkin@xxxxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Mon, 21 May 2007 16:05:30 +1000
> >> 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@xxxxxxxxxx> 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@xxxxxxxxxxx
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- Follow-Ups:
- [gameprogrammer] Re: std::string alternative
- From: Kevin Jenkins
- References:
- [gameprogrammer] std::string alternative
- From: Kevin Jenkins
- [gameprogrammer] Re: std::string alternative
- From: Dave Slutzkin
- [gameprogrammer] Re: std::string alternative
- From: Kevin Jenkins
- [gameprogrammer] Re: std::string alternative
- From: Dave Slutzkin
- [gameprogrammer] Re: std::string alternative
- From: Matthew Weigel
- [gameprogrammer] Re: std::string alternative
- From: David Olsen
- [gameprogrammer] Re: std::string alternative
- From: Kevin Jenkins
Other related posts:
- » [gameprogrammer] std::string alternative
- » [gameprogrammer] Re: std::string alternative
- » [gameprogrammer] Re: std::string alternative
- » [gameprogrammer] Re: std::string alternative
- » [gameprogrammer] Re: std::string alternative
- » [gameprogrammer] Re: std::string alternative
- » [gameprogrammer] Re: std::string alternative
- » [gameprogrammer] Re: std::string alternative
- » [gameprogrammer] Re: std::string alternative
- » [gameprogrammer] Re: std::string alternative
- » [gameprogrammer] Re: std::string alternative
- » [gameprogrammer] Re: std::string alternative
- [gameprogrammer] Re: std::string alternative
- From: Kevin Jenkins
- [gameprogrammer] std::string alternative
- From: Kevin Jenkins
- [gameprogrammer] Re: std::string alternative
- From: Dave Slutzkin
- [gameprogrammer] Re: std::string alternative
- From: Kevin Jenkins
- [gameprogrammer] Re: std::string alternative
- From: Dave Slutzkin
- [gameprogrammer] Re: std::string alternative
- From: Matthew Weigel
- [gameprogrammer] Re: std::string alternative
- From: David Olsen
- [gameprogrammer] Re: std::string alternative
- From: Kevin Jenkins