Behavior Designer is designed with performance in mind. During its runtime, Behavior Designer's behavior tree implementation uses a data oriented design instead of an object oriented design. This reduces the number of cache misses so the behavior tree runs faster. In addition, after the behavior tree has started executing no new heap allocations are made within Behavior Designer. With these optimizations, Behavior Designer runs very, very fast. We ran tests with thousands of behavior trees running at once. In practical situations you would never run thousands of unique behavior trees but the tests below show how fast Behavior Designer really is. These tests were performed on a PC built in mid-2011: 3.4 GHz with 16GB of RAM on Windows 7. The following behavior tree was used:
The profiler below shows the results. The Behavior Manager component was selected because all of the behavior trees are run from that GameObject.
We tried to test 16,000 behavior trees but Unity crashed before we could even hit the play button.