String compare VS number compare (v2)

Revision 2 of this benchmark created by SuperFactual on


Description

What is faster? Comparing a number or comparing a string?

Preparation HTML

<script>
  var a1 = '21EC2020-3AEA-1069-A2DD-08002B30309D',
      a2 = '21EC2020-3AEA-1069-A2DD-08002B30309A',
      a3 = '21EC2020-3AEA-1069-A2DD-08002B30309D';
  var b1 = 123244343.2343556,
      b2 = 566435.21344564,
      b3 = 123244343.2343556;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
String
a1 == a2
ready
Number
b1 == b2
ready
String ===
a1 === a2
ready
Number ===
b1 === b2
ready
String (equal)
a1 == a3
ready
Number (equal)
b1 == b3
ready

Revisions

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