python processor vs. python script - execution time

   1804   3   3
User Avatar
Member
67 posts
Joined: Jan. 2014
Online
Hi,

I have this big material node, that was saved with “node.asCode()”.
Now I want to reload it using “execfile()”.

The file has 60k+ lines, but it loads in a matter of seconds when I run inside a python script node. On the other hand it takes about 2 minutes to load when running inside a python processor node.

For this specific task I'd need to run inside a processor, since the file loading is tied to workitem generation.

What could be the cause for such a big difference in the execution times ?

thanks.
User Avatar
Member
159 posts
Joined: Feb. 2018
Offline
As far as I understand, the Python Script node is just the onCookTask callback in the Python Processor node. You can set the file path onGenerate(set isInprocess=True inProcess=True to perform an in-process cook) and load it onCookTask.
Edited by EricSheng - March 15, 2020 10:34:51
User Avatar
Member
67 posts
Joined: Jan. 2014
Online
Eric, that's exactly what I need. thanks a lot for the reply!
A small correction: the argument name is “inProcess” and not “isInProcess”, for anybody else reading it.

thanks.
User Avatar
Member
159 posts
Joined: Feb. 2018
Offline
fabriciochamon
Eric, that's exactly what I need. thanks a lot for the reply!
A small correction: the argument name is “inProcess” and not “isInProcess”, for anybody else reading it.

thanks.
Thank you for the correction, I've edited the answer for convenient.
  • Quick Links