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 jQuery On vs Click (v19) Revision 19 of this benchmark created on August 14, 2014 Description .on('click', ... vs .click(...
Preparation HTML <div id ="Container" >
</div >
<script src ="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" >
</script >
Setup var link_id, link_class, native_id, native_class;
Benchmark .prototype .setup = function ( ) {
var content = '' ;
for (var i = 0 , total = 1000 ; i < total; i++){
content += '<div><a href="#" id="link-a-' +i+'" class="link link-' +i+'">Link-' +i+'</a></div>' ;
}
$('#Container' ).html (content);
link_id = $('#link-a-475' );
link_class = $('.link-476' );
native_class = document .querySelector ('.link-477' );
native_id = document .querySelector ('#link-a-478' );
};
Test runner Ready to run.
Run Quick Run Testing in Test Ops/sec click #id link_id.click (function (e ) {
e.preventDefault ();
return false ;
});
ready
on #id link_id.on ('click' , function (e ) {
e.preventDefault ();
return false ;
});
ready
click .class link_class.click (function (e ) {
e.preventDefault ();
return false ;
});
ready
on .class link_class.on ('click' , function (e ) {
e.preventDefault ();
return false ;
});
ready
native class native_class.addEventListener ('click' , function (e ){
e.preventDefault ();
return false ;
});
ready
native id native_id.addEventListener ('click' , function (e ){
e.preventDefault ();
return false ;
});
ready
Revisions You can edit these tests or add more tests to this page by appending /edit to the URL.
Revision 1 : published on April 4, 2012 Revision 2 : published by DJI on July 20, 2012 Revision 3 : published on March 28, 2013 Revision 4 : published by test12344 on April 30, 2013 Revision 5 : published on May 16, 2013 Revision 6 : published on July 19, 2013 Revision 7 : published on July 19, 2013 Revision 8 : published on July 19, 2013 Revision 9 : published on July 20, 2013 Revision 10 : published on July 20, 2013 Revision 11 : published on October 3, 2013 Revision 12 : published on December 7, 2013 Revision 13 : published on February 6, 2014 Revision 14 : published on March 11, 2014 Revision 16 : published on June 5, 2014 Revision 17 : published on July 28, 2014 Revision 18 : published on August 13, 2014 Revision 19 : published on August 14, 2014 Revision 20 : published on October 6, 2014