About result "A" in c# component


(Andrealu2012) #1

private void RunScript(Point3d P, double dx, double dy, double dz, ref object A, ref object E1, ref object E2, ref object E3)
P.X = P.X + dx;
P.Y = P.Y + dy;
P.Z = P.Z + dz;
A = P;
A is a object type,so A=P,need boxing,boxing need time.can we change the object type into another?,just like input parameter,we can change the type in C# parameter?it may be faster

(Keyu Gan) #2

No. Even if you solve the box/unboxing here (which is probably impossible), there will be a lot more involved in GH solver.

If you want better performance, try to take a list input instead and use Parallel methods.

(Andrealu2012) #3

thank you,Keyu Gan ,i use list!

(David Rutten) #4

Ignore that. The time taken by boxing structs is nothing compared to the time taken by type checking the data which happens in every parameter in Grasshopper.

(Andrealu2012) #5

thank you,David