My new C# component version is slower than my previos version

I developed a component for creating a railing like 2 weeks ago. However, today decided to clean stuff and make it more tidy. However, my new version is slower and I can´t figure out why this is happening. I tryed using stopwatches with System.Diagnostics but can´t find the real reason :frowning:
I would appreciate if someone can help me understand why this happens. Thanks in advice :smiling_face_with_tear:
question.gh (14.4 KB)