Performance
Last updated
Last updated
The BindingSystem offers exceptional performance while maintaining flexibility. Here are some performance benchmarks without additional optimizations:
In the image above, the Reflection is refering to getting and setting values using code reflection. IL2CPP improves the reflection performance with respect to same logic in Mono. The Binding section refers to Binding System accessing the values, and Direct is directly accessing the data in code.
On average, Binding System is only around 1.5 times slower than directly accessing values with IL2CPP backend and around only 1.4 times slower when in Mono.
The tests have been done on a Macbook Pro 16 with M3 Max CPU. All the tests are available to be run in Unity Test Runner. For the above tests, a total of around ~2.2K of data operations (100 iterations x 22 data operations) per measurement are performed. Some data operations are not simple, some of them assign structs, other perform intermediate retrievals. This is to simulate real world usage as much as possible.
At its core, the Binding System implements a series of smart solutions to increase performance as much as possible while reducing costly memory allocations to zero when in steady state. Everything else is build on top of this core. There may be some slowdowns when using multiple modifiers and complex converters, due to more cache misses and function calls overhead. The slowdown due to modifiers and converters in most situations is negligible.