summaryrefslogtreecommitdiff
path: root/lib/events.js
diff options
context:
space:
mode:
authorRyunosuke SATO <tricknotes.rs@gmail.com>2013-05-26 05:03:02 +0900
committerBen Noordhuis <info@bnoordhuis.nl>2013-05-30 14:50:14 +0200
commit7ce5a310612bfcfc153836e718fe3c6309369fb4 (patch)
treea6ee3c84223d271a810d58071c5df40417feb633 /lib/events.js
parent6af8788f3ee53bc8471634e905a0a156e39e2ca9 (diff)
downloadnodejs-7ce5a310612bfcfc153836e718fe3c6309369fb4.tar.gz
nodejs-7ce5a310612bfcfc153836e718fe3c6309369fb4.tar.bz2
nodejs-7ce5a310612bfcfc153836e718fe3c6309369fb4.zip
events: define properties on prototype
Speeds up EventEmitter object construction by about 15-20%.
Diffstat (limited to 'lib/events.js')
-rw-r--r--lib/events.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/events.js b/lib/events.js
index a5cf6d488..9c2ba5442 100644
--- a/lib/events.js
+++ b/lib/events.js
@@ -37,6 +37,9 @@ function EventEmitter() {
}
exports.EventEmitter = EventEmitter;
+EventEmitter.prototype.domain = undefined;
+EventEmitter.prototype._events = undefined;
+EventEmitter.prototype._maxListeners = undefined;
// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.