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

events: optimize adding and removing of listeners more #785

Closed
wants to merge 2 commits into from

Commits on Feb 10, 2015

  1. events: move slow path to separate function too

    This keeps in line with how things are done for the fast path
    and *might* even provide a *slight* performance increase.
    mscdex committed Feb 10, 2015
    Configuration menu
    Copy the full SHA
    1573272 View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2015

  1. events: optimize adding and removing of listeners

    These optimizations result in >2x speedup in the ee-add-remove
    benchmark:
    
    * Don't mutate array.length when removing the last listener for
    an event
    * Don't bother checking max listeners if listeners isn't an array
    * Don't call delete when removing the last event in _events, just
    re-assign a new object instead
    mscdex committed Feb 11, 2015
    Configuration menu
    Copy the full SHA
    a29f3d3 View commit details
    Browse the repository at this point in the history