events.js performance improved