Ive also found that if it is all in one line it can perform faster.

I did a test wondering if using pipes were faster or not. It turned a line using pipes was faster than spreading it out on each line. (I do not advocate overusing pipes, my test invloved 4 or 5 in one line.)

I assumed this was because it was all on one line. If a script is read line by line, it would grab all information in the ONE line and process each faster than if it would go to each step on a seperate line.

Again, the "WHY" is speculation, but the tests showed pipes (using one line) can be a bit faster than using multiple lines.

This is why I think your 2nd option is faster, as well as what Genius said. If the first comparison is true it will just skip to the command.

Also, $iif is much slower than if (comparison) { command }.

$iif is nice to use when a traditional if statement cannot be used. Other than that, try and always use if.