PubSubSubcribe
JavaScript performance comparison
Info
Comparing the subscribe speeds of mroderick/PubSubJs, ifandelse/PostalJs, and uxder/radiojs
Preparation code
<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>
Benchmark.prototype.setup = function() {
var mroderick = PubSub;
var uxder = radio;
var ifandelse = postal;
var sub1;
var sub2;
var sub3;
};
Benchmark.prototype.teardown = function() {
if(sub1) {
mroderick.unsubscribe(sub1);
}
if(sub2) {
sub2.unsubscribe();
}
if (sub3) {
uxder("topic").unsubscribe(sub3);
}
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
mroderick pubsub |
|
pending… |
ifandelse postaljs |
|
pending… |
uxder Radio |
|
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:
- Revision 1: published by Lucas Martin
- Revision 2: published by Lucas Martin
- Revision 3: published by Lucas Martin
- Revision 4: published
0 comments