Why push and pop task cost so much performance

Justin

Administrator
Staff member
If you drill down into the profiler what is causing the most amount of time? It could be one of the tasks has an end function that takes a lot of time.
 

Justin

Administrator
Staff member
It looks like it is traversing many tasks during a single frame and it has some conditional aborts to remove which takes some time. On the Behavior Manager you change the Tax Execution Type to Count and then specify the maximum number of tasks that should execute during a single frame. This will limit the amount of work done for a single frame and should help with this situation. You can also specify a different update interval or tick the tree yourself for more fine grained control.
 

Justin

Administrator
Staff member
On the behavior tree component you can enable task logging which will output the push and pop state of the tasks. Beyond that you can import the runtime source and output the task count within the behavior manager.
 
Top