First I did “pip install arrow” on any existing iron python installation. (it is just sample lib for testing purpose) add them to script engine.
scriptRun.ScriptSource.ModulesSearchPaths.Add(“C:\IronPython 2.7\Lib”);
scriptRun.ScriptSource.ModulesSearchPaths.Add(“C:\IronPython 2.7\Lib\site-packages”);
then do script compile and run the run function.
for code like:
import arrow
def run ():
ff = open(“smth.txt”, “a”)
ff.write(str(arrow.utcnow())+ ‘\n’);
ff.close();
It takes very long time to run function for first time. Doing any change to script or just setting flag (ScriptSource.Changed = true;) will cause long compile time again. Is there any possible way to reuse previous part compilation, that startup time would be faster.
I guess it is because of “Jitting”. Every time it starts from scratch jitting everythin even for library that was not changed? Maybe it would be possible to cache resutls? save to dll or smth?