Global Variables for every Blueprint scripts?

ok…I did the performance test for casting…is not perfect but at least I can make some metrics.
I created a level where I spawn 5000 basic actors in the beginplay BP (actor is just a BP with a cube mesh, one boolean variable and a bind event to a dispatch for invert the bool value)

Binded 3 keys for shoot the test.

D - call the dispatcher and all the actors switch the bool. I measure the time before and after the dispatch call and show results in yellow.

T - get all actors with a tag…then for each ( I have to case em! :() switch the variable (val = !val)
show results in green

C - get all actors then for each I cast all the actors to find the right ones and switch the bool.
Results in light blue.

absolute winner: dispatcher.

mindblown: difference between Editor run and Standalone in performance.

Editor results:

image

Standalone:

image

wow!! hard to measure and incredible performance boost!

ok…just my 2 cents testing it L(
Cya!

2 Likes