Grasshopper

algorithmic modeling for Rhino

Hi everyone, 

is there anyone that have a idea for optimizing outputs from scripted components, I am working on a UI tool that allows for mouse interactions.  And when I am outputting DataTrees(with approximately 18000 objects) my components takes between 150-250 ms, but if I output arrays the component takes 4-11 ms - only problem is that system.arrays arent recognized as GH objects which makes them useless to me. 

any suggestions are more than welcome:) 

see attached images for more info.

Views: 395

Attachments:

Replies to This Discussion

Hi,

please provide an example. I dont realy understand. Is your output a DataTree (a real one) or just a list? Do you realy need a DataTree? Some lines of code can help to better understand your problem...

Best,

Raul

Hi Jens,

As far as I can tell outputting large lists/datatrees of any type is a general bottleneck in GH Scripting.

One approach to work around this is to "wrap" the data in a container which will output as an item instead of a list/datatree. In GHPython you can wrap stuff using a list or a dictionary. I think the same should be possible with C#. This of course means that you can't directly input this data to native GH components, but will have to "unpack" it or use it directly in a downstream scripting component (which is what I've been doing).

There are also other tricks. For instance, instead of outputting a large lists of points you can make a polyline or a mesh and just output this as one item. Developing a compiled component would probably also make things quite a bit faster I would imagine.

/A

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service