Jump to content

Recommended Posts

Posted

In situations where I can use If, Switch, or Select, which one is the fastest....not preference, but functionally more efficient and faster. The function I'll be doing will be cycling through 45 if, switch, or select.

Posted

Nothing is stopping me from testing it beyond I am working on something else at the moment and it wouldn't be difficult or time consuming for someone who readily has the knowledge and answer to provide it so when I'm done I can get right into it without doing something extra that is time consuming. 

  • Developers
Posted

I actually did do a search with "switch" and "if" in the title but "if" wouldn't return any results...(I guess too common of a word?)... and I got too many unrelated results, that's why I asked. Thank you, I'll remember to search through google when needing common words.

Posted (edited)

Just because I've had the same question and tested this a bit myself, here's results from a test that I ran in 2018:

bCRGEc6.png

From this, Switch was always the fastest, and if you can, you should set/keep OnEventMode off. Things depend though, and you may not be able to always use Switch, or the different logic needed to get a specific way working may introduce additional slowdowns

Edit: Just to be clear, the OnEventMode stuff doesn't have any direct connection/impact with Select/Switch/If, it's just something else that I was testing at the same time. In general things are a bit slower with OnEventMode, not just Select/Switch/If

Edited by mistersquirrle

We ought not to misbehave, but we should look as though we could.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...