mroderick-PubSubJs Vs ifandelse-PostalJs

JavaScript performance comparison

Test case created by Lucas Martin

Info

Comparing the subscribe speeds of mroderick/PubSubJs Vs ifandelse/PostalJs

Preparation code

<script src="//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/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>
Benchmark.prototype.setup = function() {
    var mroderick = PubSub;
    var ifandelse = postal;
   
    var sub1;
    var sub2;
};

Benchmark.prototype.teardown = function() {
    if(sub1) {
       mroderick.unsubscribe(sub1);
    }
   
    if(sub2) {
       sub2.unsubscribe();
    }
};
</script>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
mroderick pubsub
mroderick.subscribe("test",function() {
});
pending…
ifandelse postaljs
ifandelse.subscribe({
   channel: "channel",
   topic: "topic",
   callback: function() {
   }
});
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment