Re: goocanvas memory usage for model-controller



On Wed, 2009-04-01 at 17:24 +0100, Ed Griffiths wrote:
> Hi,
> 
> I looked through previous posts and couldn't see anything that addressed this:
> 
> I currently work on a project that uses foocanvas, I can see obvious advantages 
> to changing to goocanvas but I wanted to ask about the following scenario...
> 
> The program I work on creates a large number of canvas items, enough for memory 
> usage to be something that needs to be thought about. I need to be able to split 
> the canvas window 2, 3 or more times.
> 
> In foocanvas I have to duplicate the whole canvas, items and all, for each 
> window resulting from the split.
> 
> In goocanvas I was hoping that the MVC split would enable me to use less memory 
> but having read the architecture page I'm not so sure. It would seem that the 
> model items will _not_ need to be duplicated which is what I expected and is 
> great. BUT it seems there is a whole other duplicate set of canvas items that 
> will need to be duplicated so I might even end up worse off than with the 
> foocanvas.
> 
> Is that right or am I being an idiot.....

That is right. You would need one set of model items, plus one set of
view items for each canvas.

If your items implemented the GooCanvasItem interface directly, rather
than subclassing GooCanvasItemSimple, you might be able to make them
smaller, maybe down to something like 16 bytes each.

Or it may be better to combine some of your items into larger ones - the
canvas may struggle with millions of items anyway.

Damon




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]