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 https://www.grasshopper3d.com/forum/topics/is-there-a-vb-equivalent-to-sort-points-along-curve-with-points. 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

SORTALONGCRV - C#.gh (11.5 KB)

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.