StateTree Poor Performance

I have an AI built using a Behavior Tree. The AI just has two states, Idle and Task. It sits in the idle state and wanders around until given a task, which it then moves to, completes and returns to the idle wander. If I spawn 400 of these AI pawns into the scene, the game thread sits as low as 12ms.

I recently started reading about StateTrees and how much more performant they are. So, I thought I’d give them a try. I recreated this AI using a StateTree. When I spawn in 400 of them, the game thread sits at almost 18ms!

Everything I’ve read talks about how much more performant StateTrees are over Behavior Trees. However, I’m not seeing this. I just wanted to find out if anyone else has done similar experiments and what they have experienced? I’m wondering if I’m alone on this, or if others have had similar results?

I have noticed two things with StateTrees that could be the cause of the performance issue I’m seeing.

1. Every task ticks. I’ve noticed (by using the debugger) that every single task within a state will tick, even if you don’t have the Tick event implemented. Most tasks don’t need to tick, but there is no way that I can see to stop this?

2. Tasks tick every frame. I have two tasks they do need to tick (same as in my Behavior Tree), however they do not need to tick every frame. In the Behavior Tree version of these tasks I can control how often they tick and have set them to 1 second. However, StateTree tasks do not appear to offer this level of control, so they always tick every frame?