Number sign

JavaScript performance comparison

Test case created by maven_peace

Preparation code

<script>
function cond(num){
    return num?num<0?-1:1:0
}

function shift(num){
    return num>>num;
}

</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Conditional check
cond(-4);
cond(4);
cond(Infinity);
cond(-Infinity);
pending…
Shift check
shift(-4);
shift(4);
shift(Infinity);
shift(-Infinity);
pending…

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

Compare results of other browsers

0 comments

Add a comment