Announcement

Collapse
No announcement yet.

Multi-cast delegates vs function access in loops: Runtime performance

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Originally posted by Zeblote View Post
    Considering the multi-cast delegate still has to iterate over each bound function to call them
    Thanks for the input! I will stick to the loops.

    Leave a comment:


  • replied
    Considering the multi-cast delegate still has to iterate over each bound function to call them, I'd guess there is no meaningful difference.

    The delegates would probably be slightly slower because the compiler can't optimize them as well as a simple loop calling the same function on a few objects.

    Leave a comment:


  • Multi-cast delegates vs function access in loops: Runtime performance

    I'm using loops which iterate over
    Code:
    TArray<UMyActorComponent*>
    to call functions in different UActorComponents. I've discovered just recently, that multi-cast delegates offer similar possibilities.

    Would it improve the runtime performance, if I remove the loops and use multi-cast delegates instead (so I won't have to iterate over a TArray to access each function). Or are multi-cast delegates not faster in that regard?
    Last edited by Roi Danton; 05-14-2017, 06:34 AM.
Working...
X