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 A Comparison of JS Publish/Subscribe Approaches (v11) Revision 11 of this benchmark created on January 28, 2012 Description A Comparison of JS Publish/Subscribe Approaches
More info: publish/subscribe on Wikipedia.
Compared:
Preparation HTML <script src ="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" >
</script >
<script src ="https://raw.github.com/mroderick/PubSubJS/master/src/pubsub.js" >
</script >
<script src ="https://raw.github.com/phiggins42/bloody-jquery-plugins/master/pubsub.js" >
</script >
<script src ="https://raw.github.com/phiggins42/bloody-jquery-plugins/55e41df9bf08f42378bb08b93efcb28555b61aeb/pubsub.js" >
</script >
<script src ="https://raw.github.com/gist/1695338/736bcf94f9226d975fce3ad4f2bc08ccbf176bad/pubsub.js" >
</script >
<script src ="https://raw.github.com/appendto/amplify/master/core/amplify.core.js" >
</script >
<script src ="https://raw.github.com/maccman/spine/master/lib/spine.js" >
</script >
<script >
var callback = function ( ) {
};
var payload = {
somekey : 'some value'
};
var body;
var handle;
jQuery (function ( ) {
$(window ).bind ('my-event' , callback);
PubSub .subscribe ('my-event' , callback)
$.subscribe ('my-event' , callback);
handle = Events .subscribe ('my-event' , callback);
App .subscribe ('my-event' , callback);
amplify.subscribe ('my-event' , callback);
Spine .bind ('my-event' , callback);
});
</script >
Setup var callback = function ( ) {
};
var payload = {
somekey : 'some value'
};
var body;
var handle;
jQuery (function ( ) {
$(window ).bind ('my-event' , callback);
PubSub .subscribe ('my-event' , callback)
$.subscribe ('my-event' , callback);
handle = Events .subscribe ('my-event' , callback);
App .subscribe ('my-event' , callback);
amplify.subscribe ('my-event' , callback);
Spine .bind ('my-event' , callback);
});
Test runner Ready to run.
Run Quick Run Testing in Test Ops/sec jQuery Events
$(window ).bind ('my-event' , function ( ){
deferred.resolve ();
});
$(window ).trigger ('my-event' );
$(window ).unbind ('my-event' );
ready
PubSubJS PubSub .publish ('my-event' , payload);
ready
jQuery PubSub plugin $.publish ('my-event' , [payload]);
ready
Pure JS PubSub Events .publish ('my-event' , [payload]);
ready
Darcy Clarke App .publish ('my-event' , [payload]);
ready
Amplify Pub/Sub amplify.publish ('my-event' , payload);
ready
Spine Events Spine .trigger ('my-event' , payload);
ready
Revisions You can edit these tests or add more tests to this page by appending /edit to the URL.
Revision 1 : published by Morgan Roderick on October 12, 2010 Revision 3 : published by Morgan Roderick on November 28, 2010 Revision 4 : published on April 19, 2011 Revision 5 : published by Stephen Crosby on June 9, 2011 Revision 6 : published by Andrew Betts on July 22, 2011 Revision 8 : published on September 24, 2011 Revision 11 : published on January 28, 2012 Revision 12 : published by Morgan Roderick on January 30, 2012 Revision 18 : published on February 9, 2012 Revision 19 : published on February 21, 2012 Revision 20 : published on March 12, 2012 Revision 21 : published on April 5, 2012 Revision 22 : published by Richard on May 2, 2012 Revision 24 : published by Hiroshi Kuwabara on May 11, 2012 Revision 25 : published on May 24, 2012 Revision 26 : published by s0ber on May 25, 2012 Revision 30 : published by Jakeb on June 12, 2012 Revision 31 : published by Jakeb on June 12, 2012 Revision 34 : published by pmelande on June 23, 2012 Revision 36 : published by pmelande on June 24, 2012 Revision 37 : published by pmelande on June 25, 2012 Revision 39 : published by Jakeb on June 27, 2012 Revision 40 : published by Jakeb on June 28, 2012 Revision 41 : published by pmelande on June 28, 2012 Revision 43 : published by Morgan Roderick on July 3, 2012 Revision 44 : published by Jakeb on July 17, 2012 Revision 47 : published by asyraf on July 27, 2012 Revision 50 : published by pmelande on August 6, 2012 Revision 51 : published by pmelande on August 7, 2012 Revision 52 : published by Jakeb on August 12, 2012 Revision 53 : published on August 21, 2012 Revision 54 : published on August 29, 2012 Revision 55 : published on September 24, 2012 Revision 56 : published by Anas Nakawa on September 27, 2012 Revision 57 : published on September 29, 2012 Revision 58 : published on September 30, 2012 Revision 59 : published by Burke on October 1, 2012 Revision 60 : published by Tobias Haustein on October 22, 2012 Revision 62 : published by vlazar on November 23, 2012 Revision 64 : published by Stuart on December 1, 2012 Revision 66 : published by Brandon Papworth on December 9, 2012 Revision 67 : published on December 25, 2012 Revision 68 : published on January 2, 2013 Revision 69 : published on January 7, 2013 Revision 70 : published on January 21, 2013 Revision 73 : published on February 7, 2013 Revision 74 : published on February 7, 2013 Revision 75 : published by Wojciech Dłubacz on February 8, 2013 Revision 76 : published on February 8, 2013 Revision 77 : published on February 8, 2013 Revision 78 : published by Wojciech Dłubacz on February 10, 2013 Revision 79 : published on February 18, 2013 Revision 80 : published by Sparda on February 19, 2013 Revision 82 : published on February 22, 2013 Revision 83 : published by Bruno on February 25, 2013 Revision 85 : published on March 1, 2013 Revision 86 : published on March 26, 2013 Revision 87 : published on March 26, 2013 Revision 88 : published on March 26, 2013 Revision 89 : published on March 28, 2013 Revision 90 : published on April 2, 2013 Revision 91 : published on April 5, 2013 Revision 92 : published by Caleb Gilbert on April 7, 2013 Revision 93 : published on April 15, 2013 Revision 94 : published on April 21, 2013 Revision 95 : published on April 21, 2013 Revision 97 : published by Brandon Papworth on May 4, 2013 Revision 99 : published on May 9, 2013 Revision 100 : published on May 9, 2013 Revision 101 : published on May 9, 2013 Revision 102 : published on May 9, 2013 Revision 105 : published on May 29, 2013 Revision 106 : published by bobi on June 20, 2013 Revision 110 : published by RichardH on July 16, 2013 Revision 111 : published by RichardH on July 17, 2013 Revision 112 : published on July 23, 2013 Revision 113 : published on July 27, 2013 Revision 114 : published on August 14, 2013 Revision 116 : published on August 28, 2013 Revision 118 : published by Tom Taylor on September 6, 2013 Revision 119 : published on September 17, 2013 Revision 120 : published on October 4, 2013 Revision 123 : published on November 13, 2013 Revision 124 : published on November 13, 2013 Revision 125 : published on November 14, 2013 Revision 126 : published on November 14, 2013 Revision 127 : published on November 15, 2013 Revision 128 : published on December 1, 2013 Revision 129 : published on December 1, 2013 Revision 130 : published on December 17, 2013 Revision 132 : published on January 20, 2014 Revision 134 : published on January 23, 2014 Revision 135 : published by Anas Nakawa on February 25, 2014 Revision 136 : published on February 28, 2014 Revision 137 : published on March 7, 2014 Revision 138 : published on March 7, 2014 Revision 140 : published on April 16, 2014 Revision 142 : published by andychups on May 2, 2014 Revision 143 : published by andychups on May 3, 2014 Revision 144 : published on May 4, 2014 Revision 145 : published on May 10, 2014 Revision 151 : published by niaher on June 24, 2014