Two identical scripts are running at different speed (60% slower)

I’ve been going insane over these two… the image labeled with “2” is the original version, the image labeled with “1” is the new version that’s now a part of a larger script.

Both are, however, equivalent scripts and they execute the same way. The parameters are set to be identical. The only difference is in deparametrisation method, but even swapping the new one with an old one doesn’t affect performance at all.

Unfortunately, I can’t share the scripts themselves publicly (but I will be able to privately send it to a McNeel employee), so I share this diagram with colour-labeled modules for each of the scripts and their respective performance summary.

If anyone has any ideas, please make sure to share them. Thanks in advance.

How did you calculate the 160 % difference?

27 / 44 * 100 = 61.364

44/27 results in 1.6 times the baseline execution time. I didn’t mean percentage, I wanted to say X times slower, sorry. In percentage it’s (44/27 - 1) * 100 = 62.962% slower.

Don’t want to blame anyone but I’m also wondering if the bottle neck evaluation is accurate and adding up the times is done correctly.

It’s not really accurate, because it still reads the time static components took to initialise. However, their influence can be excluded by assessing only the values that do change. And since I use sliders to position a section, I can feel if it’s sluggish or not.

I was able to identify the culprit. The section calculation for some reason lost its type hint and instead of polyline segments it was sending out lines that then were being converted to curves by Grasshopper on every step.

I chose to revert the output to ‘no type hint’ and made sure the conversion happened internally. That seems to have fixed the issue.