Documentation

Learn how to use FlowCanvas

Performance Test

A lot of work has been put into performance optimizations, however since FlowCanvas does not generate c# code, it naturally also is slower than actual code, but not by that much. However the fact that no c# code is generated also allows for a friendlier workflow of approaching visual scripting a better way, which would otherwise not be possible. Following is a comparison test between c# code and a graph doing the exact same thing on 500 gameobjects. This test has been done on a JIT compiler platform (desktop) with “.NET 4x” API Compatibility.  In AOT platforms or with “.NET Standard 2” API Compatibility, performance will be slower since IL.Emit is not supported there. All this is mostly related to using the reflection nodes. If you use or make non-reflection nodes it won’t matter. It is also worth noting that in the actual build, performance will be better since some code that exists to support the editor is stripped in build. Some of those things are disabled in this performance test already.

While working in FlowCanvas you should also be aware of the following things which can be performance costly especially when they run frequently (like within an Update loop):

  • AutoConversion (connections) specifically between Value Types (eg int to float), creates garbage allocations due to unavoidable value boxing.
  • Macro Inputs and Macro Outputs specifically of Value Type ports, also create garbage due to value boxing.
  • Data Bound Fields are slower than Data Bound Properties, thus opt to use properties whenever possible.
Yes No Suggest edit
9 of 9 users found this section helpful
Suggest Edit