{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/io.js/issues/1785","labels_url":"https://api.github.com/repos/nodejs/io.js/issues/1785/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/io.js/issues/1785/comments","events_url":"https://api.github.com/repos/nodejs/io.js/issues/1785/events","html_url":"https://github.com/nodejs/io.js/pull/1785","id":80185500,"number":1785,"title":"EventEmitter: use a Map to store event listeners","user":{"login":"targos","id":2352663,"avatar_url":"https://avatars.githubusercontent.com/u/2352663?v=3","gravatar_id":"","url":"https://api.github.com/users/targos","html_url":"https://github.com/targos","followers_url":"https://api.github.com/users/targos/followers","following_url":"https://api.github.com/users/targos/following{/other_user}","gists_url":"https://api.github.com/users/targos/gists{/gist_id}","starred_url":"https://api.github.com/users/targos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/targos/subscriptions","organizations_url":"https://api.github.com/users/targos/orgs","repos_url":"https://api.github.com/users/targos/repos","events_url":"https://api.github.com/users/targos/events{/privacy}","received_events_url":"https://api.github.com/users/targos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/io.js/labels/events","name":"events","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-05-24T15:12:26Z","updated_at":"2015-05-26T01:36:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nodejs/io.js/pulls/1785","html_url":"https://github.com/nodejs/io.js/pull/1785","diff_url":"https://github.com/nodejs/io.js/pull/1785.diff","patch_url":"https://github.com/nodejs/io.js/pull/1785.patch"},"body":"This is a fix for #728.\r\n\r\nI ran the events benchmarks to compare this with master and there seems to be a significant performance drop for some cases (though I'm not sure of how I should compare the runs).\r\n\r\n| Bench              | master   | Map       |\r\n|--------------------|----------|-----------|\r\n| ee-add-remove      | 1216157   | 950515 (-22%)  |\r\n| ee-emit-multi-args | 5909434  | 5640342 (-5%)   |\r\n| ee-emit            | 8485253  | 7912000 (-7%)   |\r\n| ee-listener-count  | 432010872 | 56945905 (-87%) |\r\n| ee-listeners-many  | 3558539  | 3490269 (-2%)   |\r\n| ee-listeners       | 21596479 | 18429471 (-15%)  |\r\n"},"comment":{"url":"https://api.github.com/repos/nodejs/io.js/issues/comments/105349863","html_url":"https://github.com/nodejs/io.js/pull/1785#issuecomment-105349863","issue_url":"https://api.github.com/repos/nodejs/io.js/issues/1785","id":105349863,"user":{"login":"chrisdickinson","id":37303,"avatar_url":"https://avatars.githubusercontent.com/u/37303?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdickinson","html_url":"https://github.com/chrisdickinson","followers_url":"https://api.github.com/users/chrisdickinson/followers","following_url":"https://api.github.com/users/chrisdickinson/following{/other_user}","gists_url":"https://api.github.com/users/chrisdickinson/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdickinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdickinson/subscriptions","organizations_url":"https://api.github.com/users/chrisdickinson/orgs","repos_url":"https://api.github.com/users/chrisdickinson/repos","events_url":"https://api.github.com/users/chrisdickinson/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdickinson/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T01:36:14Z","updated_at":"2015-05-26T01:36:14Z","body":"* readable-stream is directly vendored from core's streams. Core has a need for prepending events – userland does not (with the exception of readable-stream, which doesn't seem like a good excuse to add it.)\r\n* dicer seems to be checking for specific events, which would be better done with `EE.listenerCount` or even `ee.listeners('event')`.\r\n* cloning an event emitter wholesale (like ultron is doing) is a pretty unexpected / surprising use of the EE API, I don't think we should support that."}}