I have a script and tried to optimize it for CPU path prediction. It worked perfectly, but I got one problem left:

Options are selected in the user interface, so path prediction should work. In the beginning only option 1 is activated.

if option1:

if option2:

This works, until I activate option 2. Of course, now there are 2 demanding tasks to do.

BUT: When I deactivate option 2 again, the script still executes noticebly slower than in the beginning. Resetting Blender brings the speed back. How come?

EDIT: I just need to know, that path prediction IS NOT responsible for the slow down. The case is really as simple as the pseudocode above.

  • 1
    $\begingroup$ maybe the task2 leaves something running (threads, modal operator, function appended to a handler ) $\endgroup$
    – Chebhou
    Mar 13, 2015 at 9:30
  • $\begingroup$ This is my guess too, but I've been searching a while for it without success. Updated my question. $\endgroup$
    – bortran
    Mar 13, 2015 at 9:35
  • 1
    $\begingroup$ if the code block is not repeated ,path prediction will not slow down the execution since task1 will be executed than comes the delay of the task2 prediction (which should not be noticeable), and if it's repeated the path prediction can detect if task2 is less taken and will not take its path $\endgroup$
    – Chebhou
    Mar 13, 2015 at 9:56
  • $\begingroup$ Well, I didn't even see that. It's not looped. :D Sorry guys, sometimes I'm just blind. $\endgroup$
    – bortran
    Mar 13, 2015 at 20:14


Browse other questions tagged .