Fast Sorting Points Along Curve - C#

Hi, here I’m leaving some scripts in C# and VB for sorting points along a curve, based on a discussion I found on the old forum I translated both approaches to C#, both have similar solution time but slower when compare to the grasshopper native component.
Any ideas on why the native component is faster?.. Thanks


If you make a visual studio grasshopper plugin in c# or VB dot net, it should be faster. You need to download Grasshopper plugin wizerd for visual studio and install it. Then make a c# plugin for grasshopper in Visual studio 2017 community edition. It should be faster than script inside grasshopper. But I heard that in Rhino 6 both approach should have almost same speed.