EventEmitter 3 vs 4
JavaScript performance comparison
Info
I am in the throws of rewriting my EventEmitter class. I just want to see how things are shaping up speed wise.
These tests are based on version 4 as it stood in this commit.
The versions of EventEmitter are slightly modified and stored in this gist. I have changed them so that they load under the EventEmitter3 and EventEmitter4 namespaces.
Preparation code
<script src="//gist.github.com/raw/3364020/fba327aa869714499ead3663b574598105940867/EventEmitter3.js"></script>
<script src="//gist.github.com/raw/3364020/837ef838f1d16c92e5cb0a8e98b2582675a27798/EventEmitter4.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/mootools/1.3/mootools-yui-compressed.js"></script>
<script>
Benchmark.prototype.setup = function() {
var ee,
fn1 = function(){},
fn2 = function(){},
fn3 = function(){},
fn4 = function(){},
fn5 = function(){},
fn6 = function(){},
fn7 = function(){};
};
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
EventEmitter3 - Mixed |
|
pending… |
EventEmitter4 - Mixed |
|
pending… |
MooTools - Mixed |
|
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 Oliver Caldwell and last updated
- Revision 2: published by gildas
- Revision 3: published by Oliver Caldwell
- Revision 4: published by Oliver Caldwell
- Revision 5: published
- Revision 6: published by Oliver Caldwell
- Revision 7: published by Oliver Caldwell
- Revision 8: published by Oliver Caldwell
- Revision 9: published
0 comments