[cairo] Patch: speeding up _cairo_fixed_from_double

Carl Worth cworth at cworth.org
Wed Oct 5 12:17:10 PDT 2005


On Wed, 05 Oct 2005 11:50:51 -0700, Bill Spitzak wrote:
> I also posted the same thing some time ago, not sure what happened to 
> that as I never got any response.

Would you believe it's still in my inbox? (It is, along with several
hundred other things that I really do intend to look at
eventually).

NOTE: If other people are frustrated by similarly "lost" messages,
please feel free to reply to the original message, or open up new
bugs against cairo at http://bugs.freedesktop.org. It's your choice
which forum to use.

What held me up before on doing anything with this was honestly that I
just didn't understand the code.

> Tim Rowley wrote:
> > Doing some profiling runs with gradients, I noticed that a lot of the 
> > time was disappearing into _cairo_fixed_from_double (and its 
> > descendents, ftol and floor).  Searching around I found this page that 
> > talks about doing fast floating point to integer conversion:
> > 
> >     http://www.stereopsis.com/FPU.html
> > 
> > Adapting one of the methods for cairo gave about a 25% speed increase in 
> > our gradient tests.

Thanks for the reference. And it's encouraging to get two reports of
significant speedup from this technique.

I'll be looking into this a bit more closely now, (even if only for my
own education).

Meanwhile, while I think this patch will be landing soon, I think the
big hit from _cairo_fixed_from_double in radial gradients is evidence
that the radial gradient code is still largely inefficient in even
bigger ways, which I also want to spend some time looking into today.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20051005/a37e2b58/attachment.pgp


More information about the cairo mailing list