[cairo] path storage optimizations ( was: how to propose a change? )

ionous lists at ionous.net
Thu Aug 30 12:12:56 PDT 2007

I have a version of the optimizations I described up and running now -
I've had some problems getting the very latest source ( pixman in 
particular, but also some minor stuff with the tests ) compiling under 
windows ( both vc and cygwin/gcc ) -- I will detail and ask for help in 
a separate mail. For the moment, tho, I've attached the source rather 
than git patch, in case anyone wants to take a look.

I used the pycairo's warpedtext example to measure the amount of storage 
used before and after my changes. All told there's a ~12k savings under 
gcc, and a ~10k savings under vc for the paths it generates. ( highwater 
stats below )

All in all looks pretty good -- checking out some stress tests with more 
heavy uses of primitives would be interesting.

Regarding the attached code -- it includes a whole bunch of logging code 
that while useful does make the code less maintainable -- I will 
probably rip it out before making a real patch.

Open Questions:
* Is the code managing reverse traversal of paths necessary. I didn’t 
(re)implement it in the attached because no one appears to be using it.
* What size should cairo_path_fixed_t be set to? comments indicate 512 
bytes is desirable but I don't think gcc nor visualc achieve that. gcc 
-- assuming my macro expansions are right -- comes in at a very odd 499 

High Water Stats
numbers in () are for paths under gcc.

existing cairo point/operation buffers:
num paths: 11
extra buffers: 62
total ops: 1062
total points: 2522
bytes per path : 496(499)
bytes per extra buffer : 472 (475)
total bytes: 34720 (36163)

new command streams:
num paths: 11
extra streams: 40
total commands: 226
total points: 2470
bytes per path : 496 (496)
bytes per extra stream: 468 (468)
total bytes: 24176 (24176)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: path-fixed(2).zip
Type: application/octet-stream
Size: 49641 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20070830/a46818ad/attachment-0001.obj 

More information about the cairo mailing list