algorithmic modeling for Rhino
There is no runtime difference between a C# component or a C# GHA, provided it is the same code. There is however some overhead involved with C# components. The first time they run they need to be compiled (this can take up to several seconds, but it needs to happen only once for the same code), and there's also some extra casting and data copying that goes on. This is not -necessarily- the case for compiled GHA components.
I can tell you though that if you're looking to speed up slow code, you can probably do much more worthwhile things than move it into a GHA file. You need to profile your code so you know where the bottlenecks are and then focus on fixing those.
You an use System.Diagnostics.Stopwatch to reliably and accurately measure time between two points in the code.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks a lot David,
I will try the Stopwatch, sounds promising.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by