Hello world...
Can anybody offer some advice regarding multithreading and using GH components with python? I read Steve Baer's post (here) and tested a few commands myself, *but* everything is slower when using the parallel function. And the interesting thing is that it gets slower with every run. As you can see in the attached screenshots - the first run takes a few seconds as compared to the native GH component which finishes in 224ms. After multiple runs the python component is taking 3.9 minutes to run while the native component is finishing within a millisecond of the original time. What gives? I'm running this on a PC with 8 cores.
Andrew Heumann
in my experience, ghpythonlib.components and ghpythonlib.parallel are NOT FRIENDS. You can pretty readily parallelize rhinocommon functions - but trying to parallelize the "virtual component" logic from a grasshopper component seems to cause some kind of memory leak, with progressively worse performance.
See also these posts:
http://discourse.mcneel.com/t/ghpython-parallel-component-slower-th...
http://discourse.mcneel.com/t/new-ghpython-issues-crashing-multithr...
Jul 14, 2015