• 0 Posts
  • 4 Comments
Joined 2 years ago
cake
Cake day: June 11th, 2023

help-circle
  • I think there is no obvious way of telling this, because it depends on how you if statement will be constructed and in the end what machine code will be generated from your code.

    So best thing would probably be implement both and measure the results. I would argue that’s how performance optimisations work. Don’t trust on what a forum post tells you.

    However chances are high that both will have similar performance in a range that doesn’t matter for your use case… Without knowing your use case :)