typecasting int to string (v4)

Revision 4 of this benchmark created by Kyle A. Matheny on


Test runner

Ready to run.

Testing in
TestOps/sec
+ ''
for (var i = 0; i < 100; i++) {
 var a = 100;
 var b = 0;
 a = a + '';
 b = b + '';
}
ready
+= ''
for (var i = 0; i < 100; i++) {
 var a = 100;
 var b = 0;
 a += '';
 b += '';
}
ready
String()
for (var i = 0; i < 100; i++) {
 var a = 100;
 var b = 0;
 a = String(a);
 b = String(b);
}
ready
toString()
for (var i = 0; i < 100; i++) {
 var a = 100;
 var b = 0;
 a = a.toString();
 b = b.toString();
}
ready
toString() Duplicate, I Can't Delete!
for (var i = 0; i < 100; i++) {
 var a = 100;
 var b = 0;
 a = a.toString();
 b = b.toString();
}
ready

Revisions

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

  • Revision 1: published by Jens Roland on
  • Revision 4: published by Kyle A. Matheny on