String vs Object (v3)

Revision 3 of this benchmark created on


Setup

var willemString1 = "Willem and some more text";
  var willemString2 = "Willem and some more text";
  var willemString3 = "Willem and some other text";
  var willemObject1 = new String("Willem and some more text");
  var willemObject2 = new String("Willem and some other text");
  var cnt = 0, cnt2 = 0;

Test runner

Ready to run.

Testing in
TestOps/sec
Identical - String
if (willemString1 === willemString2) {
    cnt++;
} else {
    cnt2++;
}
ready
Identical - Object
if (willemObject1 === willemObject1) {
    cnt++;
} else {
    cnt2++;
}
ready
Different - String
if (willemString2 === willemString3) {
    cnt++;
} else {
    cnt2++;
}
ready
Different - Object
if (willemObject1 === willemObject2) {
    cnt++;
} else {
    cnt2++;
}
ready

Revisions

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

  • Revision 1: published by Willem Mulder on
  • Revision 2: published on
  • Revision 3: published on
  • Revision 4: published by Steven Holms on
  • Revision 5: published by Willem Mulder on
  • Revision 6: published by Unix Superhero on
  • Revision 7: published on
  • Revision 8: published on
  • Revision 9: published on
  • Revision 10: published by Ezequiel Schwartzman on