I’d like to look at some reaction-diffusion patterns, and I’m trying to port
a C# component from this thread to Python: http://www.grasshopper3d.com/forum/topics/reaction-diffusion-on-triangular-mesh
It works, except the Python won’t multithread. On my machine the test case I’ve posted here is 69ms in C#, 6.7s in Python. I understand it won’t be as fast as the C#, but I’d rather write Python…I wouldn’t mind if it took 2-3x long but 100x?
The C# uses System.Threading.Tasks straightforwardly, and I tried this and also ghpythonlib.parallel in Python, and both are slower than no threading. (There are profiling timechecks in the code.) What’s driving me bats is that there are no rhinoscriptsyntax or Rhino functions at all in the code I’m trying to multithread, nothing but arithmetic.
I’ve read a lot of threads here and am stumped as to what is blocking this code from parallelizing. Any hints? If I ever get it working I’ll post the component.
python wont parallelize.gh (54.8 KB)