[cairo] Re: Re: Re: cairo c++ bindings
mike.emmel at gmail.com
Mon Nov 28 04:58:32 PST 2005
On 11/28/05, Murray Cumming <murrayc at murrayc.com> wrote:
> On Fri, 2005-11-25 at 15:20 +0000, Mike Hearn wrote:
> > On Fri, 25 Nov 2005 15:22:42 +0100, Murray Cumming wrote:
> > > The function is probalby just returning an integer. And we would just if()
> > > the result. Is that likely to be significant?
> > I'm not sure. For an immediate mode API like Cairo I suspect it could be.
> > OpenGL implementations usually optimize the function call overhead a lot:
> > for instance with vertex arrays, with optimized TLS implementations and so
> > on.
> > When you're doing animation, and you want to throw a bazillion
> > function calls per second through a library, cycle-level
> > optimization becomes interesting.
> > As to the result of a function call and an if statement: it might be
> > significant. It means a pipeline-stalling comparison for every function
> > call. Also, on some platforms like MacOS X cross-library calls are very
> > slow.
> So, this remains a highly theoretical performance issue, but one that
> could easily be tested.
> 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.
Can't you just use the gcc extension unlikely for the branch ?
Then it won't stall I think of couse I don't know the vodoo of those attributes.
Some of the gcc extension attributes like this may even be useful in
other parts of the
cairo code that branch since almost all calls end up testing the
existance or result of a backend function.
> cairo mailing list
> cairo at cairographics.org
More information about the cairo