{"action":"created","issue":{"url":"https://api.github.com/repos/asyncly/EventEmitter2/issues/135","labels_url":"https://api.github.com/repos/asyncly/EventEmitter2/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/asyncly/EventEmitter2/issues/135/comments","events_url":"https://api.github.com/repos/asyncly/EventEmitter2/issues/135/events","html_url":"https://github.com/asyncly/EventEmitter2/pull/135","id":51766903,"number":135,"title":"GC on both .off and .removeAllListeners","user":{"login":"AVVS","id":1713617,"avatar_url":"https://avatars.githubusercontent.com/u/1713617?v=3","gravatar_id":"","url":"https://api.github.com/users/AVVS","html_url":"https://github.com/AVVS","followers_url":"https://api.github.com/users/AVVS/followers","following_url":"https://api.github.com/users/AVVS/following{/other_user}","gists_url":"https://api.github.com/users/AVVS/gists{/gist_id}","starred_url":"https://api.github.com/users/AVVS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AVVS/subscriptions","organizations_url":"https://api.github.com/users/AVVS/orgs","repos_url":"https://api.github.com/users/AVVS/repos","events_url":"https://api.github.com/users/AVVS/events{/privacy}","received_events_url":"https://api.github.com/users/AVVS/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-12-12T03:26:17Z","updated_at":"2015-02-23T08:04:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/asyncly/EventEmitter2/pulls/135","html_url":"https://github.com/asyncly/EventEmitter2/pull/135","diff_url":"https://github.com/asyncly/EventEmitter2/pull/135.diff","patch_url":"https://github.com/asyncly/EventEmitter2/pull/135.patch"},"body":"Perform gc collection on both .off and .removeAllListeners,\r\nextract `recursivelyGarbageCollect`, add `makeShallowCopy` for cleaning\r\nlost of `null` properties, add gc invocation counters `this._gc`.\r\n\r\nGC can be controlled via env vars `GC_KEY_THRESHOLD`, defaults to 10000.\r\nWhich means that a shallow copy of object will be created if it grows over\r\nthat amount of `null` properties.\r\n\r\n`GC_FREQUENCY` controls how many calls to `recursivelyGarbageCollect` must be\r\nmade before we actually do the GC. Defaults to 50000\r\n\r\nAddition to #65, #132 \r\n\r\nWould love your comments. With default settings in my projects usual GC run takes from 150 to 250ms, which is, admittedly, not much granted how much it cleanses (ie, in an hour without that fix heap grows to 1GB).\r\n\r\nWhat I haven't explored is using `.delete` instead of making shallow copies of an object and how it really affects performance here.\r\nIdeas taken from this talk: https://www.youtube.com/watch?v=ip9LGtNsxZA"},"comment":{"url":"https://api.github.com/repos/asyncly/EventEmitter2/issues/comments/75502854","html_url":"https://github.com/asyncly/EventEmitter2/pull/135#issuecomment-75502854","issue_url":"https://api.github.com/repos/asyncly/EventEmitter2/issues/135","id":75502854,"user":{"login":"cxreg","id":55474,"avatar_url":"https://avatars.githubusercontent.com/u/55474?v=3","gravatar_id":"","url":"https://api.github.com/users/cxreg","html_url":"https://github.com/cxreg","followers_url":"https://api.github.com/users/cxreg/followers","following_url":"https://api.github.com/users/cxreg/following{/other_user}","gists_url":"https://api.github.com/users/cxreg/gists{/gist_id}","starred_url":"https://api.github.com/users/cxreg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cxreg/subscriptions","organizations_url":"https://api.github.com/users/cxreg/orgs","repos_url":"https://api.github.com/users/cxreg/repos","events_url":"https://api.github.com/users/cxreg/events{/privacy}","received_events_url":"https://api.github.com/users/cxreg/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T08:04:38Z","updated_at":"2015-02-23T08:04:38Z","body":"LGTM, asyncly can we get this merged?"}}