Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to a faster EventEmitter library #136

Open
robhawkes opened this issue Feb 28, 2015 · 0 comments
Open

Move to a faster EventEmitter library #136

robhawkes opened this issue Feb 28, 2015 · 0 comments

Comments

@robhawkes
Copy link
Member

ViziCities currently uses WildEmitter, and while it has nice features (wildcards) it's incredibly slow compared to alternatives such as EventEmitter2 and EventEmitter3. I've done some basic benchmarking in the NoFlo repo and the results are impressive – copied below. In short, moving away from WildEmitter can increase the speed of events an incredible amount.

// ms times for 1 .emit() call and 10 listeners

EventEmitter: 0.17200002912431955
WildEmitter: 0.29200001154094934
EventEmitter2: 0.07599999662488699
EventEmitter3: 0.265000038780272
bergie/emitter: 0.14700007159262896

// ms times for 100 .emit() calls and 10 listeners

EventEmitter: 1.2339999666437507
WildEmitter: 1.478999969549477
EventEmitter2: 0.6140000186860561
EventEmitter3: 0.7299999706447124
bergie/emitter: 0.775999971665442

// ms times for 1,000 .emit() calls and 10 listeners

EventEmitter: 11.360000004060566
WildEmitter: 5.018000025302172
EventEmitter2: 1.9909999100491405
EventEmitter3: 1.2839999981224537
bergie/emitter: 3.0610000248998404

// ms times for 100,000 .emit() calls and 10 listeners

EventEmitter: 422.7909999899566
WildEmitter: 318.76300007570535
EventEmitter2: 126.27300003077835
EventEmitter3: 71.41800003591925
bergie/emitter: 229.13999995216727

// ms times for 1,000,000 .emit() calls and 10 listeners

EventEmitter: 4673.170999973081
WildEmitter: 3401.6759999794886
EventEmitter2: 1148.3129999833182
EventEmitter3: 641.9809999642894
bergie/emitter: 2427.3149999789894
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant