if vs shortcirc

Benchmark created on


Setup

var defaultSelectedOption = 'moo';
var selectedOption = 'boo';
var tmp = '';
function setSelectedOption(option) {
	tmp = option;
}

Test runner

Ready to run.

Testing in
TestOps/sec
IF
if (defaultSelectedOption && defaultSelectedOption !== selectedOption) {
    setSelectedOption(defaultSelectedOption);
}
ready
SC
defaultSelectedOption && defaultSelectedOption !== selectedOption && setSelectedOption(defaultSelectedOption);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.