[Cairo] Re: The complexity problem in the spline stroking algorithm

Soorya Kuloor skuloor at verano.com
Tue Aug 26 09:48:12 PDT 2003

On Tue, 2003-08-26 at 09:15, Carl Worth wrote:
> On Aug 25, Soorya Kuloor wrote:
>  > I am interested in helping out with this O(n^2) problem. I have close to
>  > a week scheduled for speeding up Cairo, especially the higher layers
>  > (i.e. above libic). Can you please give me hints about how to speed the
>  > code up? I have gone through the code and have a pretty good idea of the
>  > code and control flow. However, I am not very clear on the math. Please
>  > let me know if you have any other things that can be speeded up.
> Obviously, before attempting any optimization work, it's important to
> do profiling to determine where the hot spots are and to be sure that
> there will be some actual payoff from the optimization, (there's no
> getting around Amdahl's Law).

This time I did the benchmarks using local image buffer (instead of
using RENDER) and found out that most of the CPU time is spent in libic.
I thought I could speed up cairo by speeding it up at the higher layers,
however the time consumed by these layers is peanuts compared to libic.
Getting rid of the tessellation during stroke will probably speed up
cairo by a very small un-noticeable amount. I found that
IcRasterizeTrapezoid() and functions that it calls take up close to 62%
of the runtime (cumulative). This is probably where the speedup needs to
happen. My earlier profiling and guesses are completely off-base.

Unfortunately, currently text rendering to local image buffers does not
work. So I cannot use this mode even if I try to speed up libic. Is
there any chance that the text work that is currently being discussed
will be done any time soon? 

-- Soorya

More information about the cairo mailing list