From 7ce5a310612bfcfc153836e718fe3c6309369fb4 Mon Sep 17 00:00:00 2001 From: Ryunosuke SATO Date: Sun, 26 May 2013 05:03:02 +0900 Subject: events: define properties on prototype Speeds up EventEmitter object construction by about 15-20%. --- lib/events.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/events.js') 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. -- cgit v1.2.3