Python 3 about 10x slower than old python component

hi there,

I’m currently updating an old gh file and ran into this problem where the new py3 component with the same script is about 10x slower than the old python component in Rhino 8.20.25157.13001 on Windows

Testfile: 2026-01-27_py3_slow.gh (28.4 KB)
This is a stripped down version of the gh file.

On initial load of the gh file they are closer, any further run results in ~10x difference.
Any ideas why? Any way to get them to a similar speed?

Thanks,
Bernd

Using .NET (e.g. RhinoCommon/rhinoscriptsyntax) in CPython (i.e. the Python 3 Script editor) is currently substantially less performant than using it in IronPython (i.e. the . NET version of Python used in the old GhPython and the new IronPython 2 Script components). See this topic:

I’m currently still using GhPython in Rhino 8 for production on anything that uses RhinoCommon. And then dabbling with the CPython component for things that are pure Python and uses PyPi packages. And kicking the tires on the new IronPython component as a future replacement for GhPython (e.g. in Grasshopper 2, which does not ship with/support GhPython, as far as I can tell).

That’s good to know, thanks!