algorithmic modeling for Rhino
It could. C# and VB are compiled to MSIL and then jitted to machine code, whereas Python is interpreted, although very cleverly.
Python performance is typically somewhat lower than C#, and even VB and C# can differ if they generate different MSIL (specifically for loops are very different in C# and VB, as VB caches the upper bound whereas C# keep on evaluating it for every iteration).
In my experience though switching languages is by far the worst thing you can do if you want to speed up some code. The first step should always be profiling. You need to find out what part of the code is slowest. It's very often not the part you might think, so don't rely on your intuition, profile the code. Then you need to optimize that part, this is the difficult part, and sometimes you're out of luck, but at least you can talk to people about how to optimize code once you've determined what code you want to optimize.
Welcome to
Grasshopper
© 2025 Created by Scott Davidson.
Powered by