CPU usage of data structures [was: Re: [PD] Re: new pmpd developer]

Frank Barknecht fbar at footils.org
Tue Mar 15 20:09:23 CET 2005


Hallo,
Nicolas Montgermont hat gesagt: // Nicolas Montgermont wrote:

> I've been experimenting pmpd with datastructure for a week now, and I 
> encounter a few problems that are all present in the attached patch:
> 
> - Computation speed! The simple model presented here (5 mass, 8 link) 
> seems to charge all my CPU at a metro period of 100ms. The string patch 
> designed by Frank Barknecht in the datastructure tutorial was much more 
> faster. Does anybody see any "bad" programming in the patch?

I tried various things now but the only thing that really helped is,
to hide the data structure display, e.g. by switching GOP off for
bonhomme.pd. Then CPU usage drops by a huge amount. So it's definitely
the graphical updates, that kill performance here. 

Anyway what I tried is this: I removed a lot of traversing inside
model-setter.pd so it now just stores the correct pointer once on
initialization. For that, I added a $0-INIT receive target, which is
bang'd in the structure subpatch after the data structres are created. 

Performance-wise it didn't help at all, but this approach might be
useful for larger structures. 

Another test I did was in the opposite direction: I suspected, that
maybe access to the array data is slowing things down. So I added
another field to the mass-struct for color. I then colorized the
movable mass on the house's roof. ;)

You can find the result in the "evenslower" subdirectory. Now this
simple little change is totally exhausting my machine. Pd (0.38) isn't
able to render the animation at all anymore when I try to move the
now red dot. 

> - The datastructure displays strangely on my linux system. Some links 
> are well connected to the mass, but the others present a kind of offset. 
> Even if the same abstraction is use to display all of them. It seems to 
> be a recurrent problem with the datastructure already discuss in the GoP 
> positions thread. Have you any newer explanations and perhaps solutions ;) ?

I moved over the masses' display by 5px to the right, which looks
better but still is off for some links. Deeper investigation needed... 

Ciao
-- 
 Frank Barknecht                               _ ______footils.org__
             
          _ __latest track: "scans" _ http://footils.org/cms/show/41
-------------- next part --------------
A non-text attachment was scrubbed...
Name: franks_home.tgz
Type: application/x-gtar
Size: 4252 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20050315/72499675/attachment.tgz>


More information about the Pd-list mailing list