Profiling of python code in rhino

Hi,
Do you run this code with a complex surface ?
When I try it on a random surface it is solved pretty fast and as quick in both part of your code.