jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase .
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2 Can be accessed at:
https://jsperf.app/negative-modulo/2 "Type of undefined" vs "=== undefined" (v33) Revision 33 of this benchmark created on February 21, 2014 Preparation HTML <script >
function typeOf (v ) {
return typeof v === "undefined" ;
}
function typeOfNonStrict (v ) {
return typeof v == "undefined" ;
}
function void0 (v ) {
return v === void 0 ;
}
function globalUndefined (v ) {
return v === undefined ;
}
var a = 1 ,
b = true ,
c = "c" ,
d = [],
e = {}, u;
var l = 10000 ;
while (l--) {
if (typeOf (a) ) {
throw new Error ("" );
}
if (typeOf (b) ) {
throw new Error ("" );
}
if (typeOf (c) ) {
throw new Error ("" );
}
if (typeOf (d) ) {
throw new Error ("" );
}
if (typeOf (e) ) {
throw new Error ("" );
}
if (globalUndefined (a) ) {
throw new Error ("" );
}
if (globalUndefined (b) ) {
throw new Error ("" );
}
if (globalUndefined (c) ) {
throw new Error ("" );
}
if (globalUndefined (d) ) {
throw new Error ("" );
}
if (globalUndefined (e) ) {
throw new Error ("" );
}
if (void0 (a) ) {
throw new Error ("" );
}
if (void0 (b) ) {
throw new Error ("" );
}
if (void0 (c) ) {
throw new Error ("" );
}
if (void0 (d) ) {
throw new Error ("" );
}
if (void0 (e) ) {
throw new Error ("" );
}
if (typeOfNonStrict (a) ) {
throw new Error ("" );
}
if (typeOfNonStrict (b) ) {
throw new Error ("" );
}
if (typeOfNonStrict (c) ) {
throw new Error ("" );
}
if (typeOfNonStrict (d) ) {
throw new Error ("" );
}
if (typeOfNonStrict (e) ) {
throw new Error ("" );
}
}
</script >
Setup var a = 1 ,
b = true ,
c = "c" ,
d = [],
e = {}, u;
Test runner Ready to run.
Run Quick Run Testing in Test Ops/sec typeof undefined if (typeOf (a) ) {
throw new Error ("" );
}
if (typeOf (b) ) {
throw new Error ("" );
}
if (typeOf (c) ) {
throw new Error ("" );
}
if (typeOf (d) ) {
throw new Error ("" );
}
if (typeOf (e) ) {
throw new Error ("" );
}
ready
=== undefined if (globalUndefined (a) ) {
throw new Error ("" );
}
if (globalUndefined (b) ) {
throw new Error ("" );
}
if (globalUndefined (c) ) {
throw new Error ("" );
}
if (globalUndefined (d) ) {
throw new Error ("" );
}
if (globalUndefined (e) ) {
throw new Error ("" );
}
ready
=== undefined(local) a === u;
b === u;
c === u;
d === u;
e === u;
ready
void 0 if (void0 (a) ) {
throw new Error ("" );
}
if (void0 (b) ) {
throw new Error ("" );
}
if (void0 (c) ) {
throw new Error ("" );
}
if (void0 (d) ) {
throw new Error ("" );
}
if (void0 (e) ) {
throw new Error ("" );
}
ready
typeof == if (typeOfNonStrict (a) ) {
throw new Error ("" );
}
if (typeOfNonStrict (b) ) {
throw new Error ("" );
}
if (typeOfNonStrict (c) ) {
throw new Error ("" );
}
if (typeOfNonStrict (d) ) {
throw new Error ("" );
}
if (typeOfNonStrict (e) ) {
throw new Error ("" );
}
ready
Revisions You can edit these tests or add more tests to this page by appending /edit to the URL.
Revision 1 : published by ukyo on April 28, 2012 Revision 2 : published by ukyo on May 13, 2012 Revision 3 : published on May 14, 2012 Revision 4 : published by Bombo on June 6, 2012 Revision 6 : published by Mihai Bazon on September 16, 2012 Revision 9 : published on March 12, 2013 Revision 11 : published by Raymond on April 23, 2013 Revision 12 : published on April 23, 2013 Revision 14 : published by Raymond on May 20, 2013 Revision 15 : published on May 20, 2013 Revision 18 : published on July 18, 2013 Revision 19 : published on July 29, 2013 Revision 20 : published on July 31, 2013 Revision 23 : published by hellraiser on September 18, 2013 Revision 25 : published by Tomas Corral on October 8, 2013 Revision 26 : published on October 8, 2013 Revision 27 : published on December 5, 2013 Revision 29 : published on December 26, 2013 Revision 30 : published on January 24, 2014 Revision 31 : published on February 21, 2014 Revision 32 : published on February 21, 2014 Revision 33 : published on February 21, 2014 Revision 34 : published on March 17, 2014 Revision 37 : published on May 13, 2014 Revision 38 : published by r on May 15, 2014 Revision 39 : published on May 20, 2014 Revision 40 : published by PAEz on May 27, 2014 Revision 41 : published on May 27, 2014 Revision 42 : published on June 2, 2014 Revision 43 : published on June 11, 2014 Revision 44 : published by Oscar Campbell on June 21, 2014 Revision 45 : published on July 8, 2014 Revision 46 : published on July 8, 2014 Revision 47 : published on July 8, 2014 Revision 48 : published on July 8, 2014 Revision 49 : published on July 8, 2014 Revision 50 : published on July 12, 2014 Revision 51 : published by Simon on August 22, 2014 Revision 52 : published by hoochieminh on September 19, 2014 Revision 53 : published on October 28, 2014 Revision 54 : published on November 26, 2014 Revision 55 : published on December 31, 2014 Revision 56 : published on January 26, 2015 Revision 57 : published on February 4, 2015 Revision 58 : published on February 27, 2015 Revision 59 : published on February 27, 2015 Revision 60 : published by darren on March 23, 2015 Revision 62 : published on April 11, 2015 Revision 63 : published on April 12, 2015 Revision 64 : published on April 12, 2015 Revision 65 : published on April 18, 2015 Revision 66 : published by bskaplou on April 20, 2015 Revision 67 : published by Ben L. Titzer on May 5, 2015 Revision 68 : published by Ben L. Titzer on May 5, 2015 Revision 69 : published by Ben L. Titzer on May 5, 2015 Revision 70 : published by Adrian Bartholomew on May 9, 2015 Revision 71 : published by Fuwei Chin on June 13, 2015 Revision 72 : published on September 29, 2015 Revision 73 : published on September 29, 2015 Revision 76 : published by Alexander on December 8, 2015 Revision 77 : published on December 28, 2015 Revision 78 : published on January 7, 2016