Re: Performance slow down because of cache method change

Bob Friesenhahn <[email protected]> Thu, 31 Mar 2005 10:14:53 -0600 (CST)
Newsgroups gmane.comp.video.graphicsmagick.apis
Message-ID <[email protected]>
On Thu, 31 Mar 2005, Bob Klimek wrote:

> Bob Friesenhahn wrote:
>
>>   Using:
>> 
>>       DrawDestroyContext(drawContext);
>>       SetImageAttribute(theImage,"[MVG]",0); // <-- new line
>> 
>>   will purge the "[MVG]" attribute so that the next
>>   drawing iteration starts fresh. It seems that this
>>   elminates the performance problem.
>> "
>> 
>> With this minor change, the loops in your test program execute in constant 
>> time for me.
>> 
> Perhaps this should be the default?!

Perhaps so.  The problem is that in order to turn a sequence of 
individual drawing API requests into the complete set of requests, all 
of the drawing requests over the life of the image need to be 
concatenated together.  This allows doing

   gm convert file.svg file.mvg

     or

   gm convert file.wmf file.mvg

where "MVG" is GraphicsMagick's native drawing "metafile" format. 
Someday when the SVG writer is fixed, it should be possible to do 
something like

    gm convert file.wmf file.svg

or

    gm convert file.eps file.svg

This last version would rely on 'pstoedit's Magick++-based driver 
which can already convert output from Ghostscript into MVG.

Since the drawing APIs in magick/draw.h do their own concatenation, a 
minor enhancement would be to update DrawRender() so it clears out any 
existing drawing list in the image.  This would have the negative 
effect that if the API user performs a series of separate requests 
with their own DrawRender() step (in order to update the image 
immediately), only the last drawing request would be saved.

Bob
======================================
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/


-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/Info/Sentarus/hamr30