I have a few questions/issues with the latest release of ghpython.
First - I have an issue with the python editor crashing intermittently. This has even happened when making a modification to the script @stevebaer provided on his blog: “ghpython_components_sample2.gh”. Simply upping the plane count to 300 and making a modification to the script (adding “print(‘hey’)” after “slices = ghpythonlib.parallel.run(slice_at_angle, planes, True)” caused rhino to crash. I cannot cause it to happen consistently, but I have noticed it several times now.
Second - I only rarely have success achieving a performance improvement by multi-threading a function with python. In the attached example, the parallel python script is always slower than both a non-parallel version of the same script (switched with the attached toggle) as well as the original component itself. Am I structuring my script wrong?
Third (maybe most important) - I am concerned that some sort of memory leak is occurring. I have now noticed several times that every time a complex, multithreaded python script runs, its execution time is significantly slower than the previous time, even with identical data. In the attached definition, when I enable the python component the first time, it calculates in 8.4 seconds. If I repeatedly reconnect one of the inputs, it goes up to 13.8, then 24.8, then upwards of 2 minutes. See the attached video for one example of such a run cycle. I have edited the video for speed but you can clearly see the difference.
Finally - I notice that sometimes with mutlithreaded python scripts, the component appears to update prematurely - downstream components will update (like the panel in the video) before the calculation is complete.