algorithmic modeling for Rhino
Hello,
Unless this has already been done, I wanted to raise the question of data copying in GH.
I understand why each component keeps its results in memory but this is sometimes not needed and the cost of memory can be super high with large amount of data or large patches.
There could be a flag for each component allowing the copy and/or the saving of its passed values ? For instance, the calculation would be redone every time the inputs change or every time a new connection is done... This way a lot of memory would be saved.
What is your opinion about this question ?
Tags:
If I understand your question correctly, this is a large part of what the new "Geometry Cache" component is designed for. See the thread here, where the idea was first raised. It only works on geometric data, but this is the real memory hog anyway.
Is this the kind of thing you're talking about, or am I misunderstanding?
Hi Olivier,
data is shared amongst parameters (unless it's being post-processed by an Expression or something), so there's no real overhead in terms of copying, either performance or memory wise.
There are however plenty things that can be done to reduce memory usage. I could for example not store any data in output parameters that don't have any wires plugged into them. This would be a fairly easy optimization, one that can be enforced at the earliest stage of data storage.
Just wiping parameters willy nilly is not going to do much good, because the data inside them is most likely also used inside other parameters, and thus won't go away so easily. Long story short; yes, it is possible to implement optimizations that could drastically reduce memory usage, but the logical foundation of these optimizations is quite complex. It's not at all obvious whether I'll be able to handle the complexity entirely behind the scenes or whether one needs a thorough understanding of the Grasshopper memory model to be able to apply these optimizations as a user.
I've been thinking about this on and off for a while now, but the only conclusion I've been able to reach is that the topic is too difficult to make any intelligent statements without actually writing code and trying it.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2025 Created by Scott Davidson.
Powered by