elefher / glmatrix

Automatically exported from code.google.com/p/glmatrix
0 stars 0 forks source link

Revert == 0 to ! optimization #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Looks like it is not an optimization after all:

<html>
<script type="text/javascript">

function a(x) {
    if (!x){}
}

function b(x) {
    if (x==0){}
}
var n = 30000000;
var len = 10;
var d=new Date();
do {
       a(0);
}
while(n--);
var e = new Date() -d;
var a = 10;
var n = 30000000;
var len = 10;
var f = new Date();
do {
     b(0);

}
while(--n);
var g = new Date() -f;

alert(e);
alert(g);
</script>
</html>

Original issue reported on code.google.com by danielhe...@gmail.com on 14 Jun 2010 at 6:51

GoogleCodeExporter commented 8 years ago

Original comment by Tojiro@gmail.com on 1 Jul 2010 at 9:35

GoogleCodeExporter commented 8 years ago

Original comment by Tojiro@gmail.com on 2 Jul 2010 at 10:03