[cairo] Re: Re: Re: Re: cairo c++ bindings

Mike Hearn mike at plan99.net
Mon Nov 28 10:18:59 PST 2005


On Mon, 28 Nov 2005 10:33:02 +0100, Murray Cumming wrote:
> So, this remains a highly theoretical performance issue, but one that
> could easily be tested.

Right.

> If it is a problem, then the proposed disabling of exceptions would
> mostly eliminate it, by leaving us with just one extra
> if(exceptions_enable) for each function call. I can't imagine what you'd
> be drawing for which that would be a significant amount of work.

Even better, make two classes (maybe using a template? I'm no C++ expert)
which have identical code except with a different initialization value for
the constant "exceptions_enable", that way the dead code elimination pass
will delete the check entirely and you have optimal code. Then the
programmer can just switch between them using "new CheckedCairo" or "new
Cairo" for instance.

thanks -mike



More information about the cairo mailing list