I read that for loop is an expensive operation because Loop iterations will take place between frames, so large loops may incur a performance hit.
But what the matter with the While Loop? It is faster/cheaper then for?
Thx: Viktor
I read that for loop is an expensive operation because Loop iterations will take place between frames, so large loops may incur a performance hit.
But what the matter with the While Loop? It is faster/cheaper then for?
Thx: Viktor
Any compiler will generate practically identical byte code, Any difference in performance is negligible, that question is really old, and is called micro-optimizing,
Perhaps you can consider what is more human readable for you!
Another history is usability, meanwhile “For” is just a iterator, “while” is bit more flexible, is meant to find solutions through iterations.
Hope this answer your question
Assuming they run for the same number of loops, the performance should be effectively identical. They perform basically the same function, they just use different criteria for when they should stop.
Thanks to everyone. Unfortunately blueprints can’t handle large loops effectively.
Thanks to everyone. Unfortunately blueprints can’t handle large loops effectively.