Postal.js Subscription Analysis

JavaScript performance comparison

Revision 2 of this test case created by Jim Cowart

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script src="http://documentcloud.github.com/underscore/underscore-min.js">
</script>
<script src="https://raw.github.com/ifandelse/postal.js/v0.6.0_RC/lib/browser/standard/postal.js">
</script>
<script>
Benchmark.prototype.setup = function() {
    var channel = postal.channel({ topic: "topic.1" }), subA, subB;
};
</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
Channel Subscription
subA = channel.subscribe({
    callback: function(x) {
        console.log(x);
    }
});
subA.unsubscribe();
pending…
API Subscription
subB = postal.subscribe({topic: "topic.1", callback: function(x) {
  console.log(x);
}});
subB.unsubscribe();
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