Math.min vs primitive ops (v2)

Revision 2 of this benchmark created by Lukas Diener on


Preparation HTML

<script>
  var a = 100;
  var b = 101;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Math.min
var c = Math.min(a, b);
ready
primitive op
var d = a < b ? a : b;
ready
if else
if(a<b){
  var d = a;
}else{
  var d = b;
}
ready

Revisions

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

  • Revision 1: published by Lukas Diener on
  • Revision 2: published by Lukas Diener on