[cairo] Cairo and layered application

Boris Zbarsky bzbarsky at MIT.EDU
Tue Mar 6 12:43:31 PST 2007


Behdad Esfahbod wrote:
>> Are you generally interested in data of this sort?  If there's something I can 
>> do to help improve cairo performance, I'd love to help.
> 
> Definitely.  Pass 'em on.  Specifically, I'm really interested in a call
> graph to malloc.  There's a lot we can do to drop those.

I'll try to get together a more exhaustive list, but in the meantime 
https://bugzilla.mozilla.org/show_bug.cgi?id=368018 is a decent example 
(16% of total pageload time is under malloc/free, most of it called from 
cairo).  Most of the other profiles I've seen look much like this, so it 
may be worth addressing this one and then reprofiling.

I don't have a good way to generate pictorial call graphs, but as far as 
cairo calls to malloc in that testcase go (note that some of the 
callstacks might have stack frames skipped due to the profiler being 
used...):

malloc
   cairo_path_arg_buf_create
     cairo_path_fixed_add
       cairo_path_fixed_move_to
         cairo_move_to
           cairo_rectangle
         cairo_path_fixed_close_path
           cairo_close_path
             cairo_rectangle
       cairo_path_fixed_line_to
         cairo_path_fixed_rel_line_to
           cairo_rectangle

   realloc
     cairo_polygon_add_edge
       cairo_polygon_line_to
         cairo_filler_line_to
           cairo_path_fixed_interpret
             cairo_path_fixed_fill_to_traps
               cairo_surface_fallback_fill
     cairo_traps_grow_by
       cairo_traps_add_trap
         cairo_traps_add_trap_from_points
           cairo_bentley_ottmann_tessellate_polygon
           cairo_bo_edge_end_trap
             cairo_bentley_ottmann_tessellate_polygon

   cairo_bentley_ottmann_tessellate_polygon
     cairo_path_fixed_fill_to_traps
       cairo_surface_fallback_fill

   cairo_pattern_create_solid
     cairo_pattern_create_rgba
       cairo_set_source_rgba

   skip_list_insert
     cairo_bentley_ottmann_tessellate_polygon

   cairo_path_op_buf_create
     cairo_path_fixed_add
       cairo_path_fixed_move_to
         cairo_move_to
           cairo_rectangle
         cairo_path_fixed_close_path
           cairo_close_path
             cairo_rectangle
       cairo_path_fixed_line_to
         cairo_path_fixed_rel_line_to
           cairo_rectangle

   cairo_surface_fill_region
     clip_and_composite_trapezoids
       cairo_surface_fallback_fill

   cairo_freelist_alloc
     cairo_bentley_ottmann_tessellate_polygon

   pixman_region_create_simple
     pixman_region_create
       cairo_traps_extract_region
       clip_and_composite_trapezoids
         cairo_surface_fallback_fill
     cairo_traps_extract_region
       clip_and_composite_trapezoids
         cairo_surface_fallback_fill

   cairo_pattern_create_rgba
     cairo_set_source_rgba

In all cases, callers are listed in order from most common to least common.

-Boris


More information about the cairo mailing list