Editing PubSubSubcribe This edit will create a new revision. Your details (optional) Name Email (won’t be displayed; might be used for Gravatar) URL Test case details Title * Published (uncheck if you want to fiddle around before making the page public) Description (in case you feel further explanation is needed)(Markdown syntax is allowed) Comparing the subscribe speeds of mroderick/PubSubJs, ifandelse/PostalJs, and uxder/radiojs Are you a spammer? (just answer the question) Preparation code Preparation code HTML (this will be inserted in the <body> of a valid HTML5 document in standards mode) (useful when testing DOM operations or including libraries) <script src="https://raw.github.com/uxder/Radio/master/radio.js"> </script> <script src="https://raw.github.com/mroderick/PubSubJS/master/src/pubsub.js"> </script> <script src="https://raw.github.com/ifandelse/postal.js/master/example/standard/js/underscore.js"> </script> <script src="https://raw.github.com/ifandelse/postal.js/master/example/standard/js/postal.js"> </script> <script type="text/javascript"> var mroderick = PubSub; var uxder = radio; var ifandelse = postal.channel("channel"); var sub1; var sub2; var sub3; </script> Include JavaScript libraries as follows: <script src="//cdn.ext/library.js"></script> Define setup for all tests (variables, functions, arrays or other objects that will be used in the tests) (runs before each clocked test loop, outside of the timed code region) (e.g. define local test variables, reset global variables, clear canvas, etc.) (see FAQ) Define teardown for all tests (runs after each clocked test loop, outside of the timed code region) (see FAQ) if(sub1) { // Unsubscribe pubsubjs subscription mroderick.unsubscribe(sub1); } if(sub2) { // unsubscribe postal subscription sub2.unsubscribe(); } if(sub3) { // Unsubscribe radio subscription uxder("topic").unsubscribe(sub3); } Code snippets to compare Test 1 Title Async (check if this is an asynchronous test) Code sub1 = mroderick.subscribe("test", function() {}); Test 2 Title Async (check if this is an asynchronous test) Code sub2 = ifandelse.subscribe({ topic: "topic", callback: function() {} }); Test 3 Title Async (check if this is an asynchronous test) Code uxder("topic").subscribe(sub3 = function() {});