We've got a number of python libraries that need to be called from inside some loops in .NET that are just too slow. We're using Process.Start, which is taking about 1/3 of a second per call, which means that a few dialogs take 30 seconds to load (on an 8 core machine - our customers will most likely have much slower computers).
For various reasons, we can't use IronPython (such as some of the files using the csv module which has known issues with IronPython).
What can I do to speed things up? Even though I'm a python newb, some of these functions are simple if elif else
blocks, and some profiling shows the main "cost" is starting python.exe
a few dozen times. Is there some secret options to starting a single python process and streaming things in and out?
A similar question is this one.