Why push and pop task cost so much performance

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.
 
this is the one of popTask, none of condition or action called. but cost 1.47ms in 21 calls
1579004705396.png
 

Attachments

  • 1579004633977.png
    1579004633977.png
    235 KB · Views: 0
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.
 
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