Marshall,
As you know, I'm trying to build up a picture of what causes these huge performance issues that you have experienced. When I look at the problem of deep cloning, I don't see it being limited to SpeechSequence since IfElse and While also do cloning. From the data I have from Brian Carlson on the "Long Compile Times" thread, he has close to 1,000 activities and is not experiencing a long compile time, but is experiencing a significant 1st-call delay (he doesn't specify about subsequent calls). I also have a copy of your original "10 minute compile" application and that has 2,300 activities.
My feeling about this issue is that the relevant factor is how many activities in total there are in the workflow, not so much how deeply nested the SpeechSequences are. Lets compare:
- a workflow with an ifElse containing 5 branches, each with a SpeechSequence containing 200 child activities.
- a workflow with 5 nested ifElse activities, such that the left branch of each ifElse contains a single activity, and the right branch is a SpeechSequence containing 200 activities culminating in the nested SpeechSequence.
For both workflows, there is a total of ~1,000 activities.
For (1) all 1,000 activities will be cloned when the workflow starts, then again by the ifElse, but when executing a particular SpeechSequence, only 200 activities will be cloned. If each branch of the ifElse is visited in turn, you have 3,000 clones in total.
For (2), as with (1), there will be 1,000 clones when the workflow starts and, for the top-level ifElse, there will be another 1,000 clones. Then we differ; the top-level SpeechSequence will clone 1,000 again, it's nested ifElse and SpeechSequence will clone 800 each, etc, to give a total cloning of 2,000+2,000+1,600+1,200+800+400 = 8,000 clones in total.
And that's assuming that there are no further cloning activities in those 1,000 (unlikely).
I've hijacked this thread too long. Suffice to say that nesting is a problem, but it's not the depth per-se, rather how many activities are contained within. Based on Brian's data, it looks like 1,000 activities within a single SpeechSequentialWorkflow is too many. Maybe 500 is a reasonable upper limit, beyond which the workflow should be broken up into multiple SpeechSequentialWorkflows?
Martial - you report that you haven't experienced problems. What size workflows are you using? Please respond to this thread: http://gotspeech.net/forums/thread/7198.aspx.
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm