{"action":"created","issue":{"url":"https://api.github.com/repos/jashkenas/backbone/issues/3476","labels_url":"https://api.github.com/repos/jashkenas/backbone/issues/3476/labels{/name}","comments_url":"https://api.github.com/repos/jashkenas/backbone/issues/3476/comments","events_url":"https://api.github.com/repos/jashkenas/backbone/issues/3476/events","html_url":"https://github.com/jashkenas/backbone/pull/3476","id":56626632,"number":3476,"title":"Implement Events as a linked list","user":{"login":"jridgewell","id":112982,"avatar_url":"https://avatars.githubusercontent.com/u/112982?v=3","gravatar_id":"","url":"https://api.github.com/users/jridgewell","html_url":"https://github.com/jridgewell","followers_url":"https://api.github.com/users/jridgewell/followers","following_url":"https://api.github.com/users/jridgewell/following{/other_user}","gists_url":"https://api.github.com/users/jridgewell/gists{/gist_id}","starred_url":"https://api.github.com/users/jridgewell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jridgewell/subscriptions","organizations_url":"https://api.github.com/users/jridgewell/orgs","repos_url":"https://api.github.com/users/jridgewell/repos","events_url":"https://api.github.com/users/jridgewell/events{/privacy}","received_events_url":"https://api.github.com/users/jridgewell/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jashkenas/backbone/labels/change","name":"change","color":"27823f"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-02-05T04:37:26Z","updated_at":"2015-02-06T20:17:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jashkenas/backbone/pulls/3476","html_url":"https://github.com/jashkenas/backbone/pull/3476","diff_url":"https://github.com/jashkenas/backbone/pull/3476.diff","patch_url":"https://github.com/jashkenas/backbone/pull/3476.patch"},"body":"[jsperf](http://jsperf.com/backbone-events-linked-list/18)\r\n\r\nRoughly equivalent performance. Using a linked list allows the events to be mutated by trigger, without skipping an event. This is a **breaking change**.\r\n\r\nEvents used to use a linked list (and switched to an array in #1284). But, it performed [very badly](http://jsperf.com/backbone-events-linked-list/8). I'm fairly certain that was due to [L106](https://github.com/jashkenas/backbone/blob/6c3d3838e10d5a070f0d1f604fb5c99ed34c8c93/backbone.js#L106) recreating the linked list's object every `#on`, and [L138](https://github.com/jashkenas/backbone/blob/6c3d3838e10d5a070f0d1f604fb5c99ed34c8c93/backbone.js#L138) calling `#on` to re-bind callbacks inside `#off`.\r\n\r\nThis fixes #3466 and closes #3463."},"comment":{"url":"https://api.github.com/repos/jashkenas/backbone/issues/comments/73305170","html_url":"https://github.com/jashkenas/backbone/pull/3476#issuecomment-73305170","issue_url":"https://api.github.com/repos/jashkenas/backbone/issues/3476","id":73305170,"user":{"login":"jridgewell","id":112982,"avatar_url":"https://avatars.githubusercontent.com/u/112982?v=3","gravatar_id":"","url":"https://api.github.com/users/jridgewell","html_url":"https://github.com/jridgewell","followers_url":"https://api.github.com/users/jridgewell/followers","following_url":"https://api.github.com/users/jridgewell/following{/other_user}","gists_url":"https://api.github.com/users/jridgewell/gists{/gist_id}","starred_url":"https://api.github.com/users/jridgewell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jridgewell/subscriptions","organizations_url":"https://api.github.com/users/jridgewell/orgs","repos_url":"https://api.github.com/users/jridgewell/repos","events_url":"https://api.github.com/users/jridgewell/events{/privacy}","received_events_url":"https://api.github.com/users/jridgewell/received_events","type":"User","site_admin":false},"created_at":"2015-02-06T20:17:32Z","updated_at":"2015-02-06T20:17:32Z","body":"Ah ha! My test was faulty. Every run was adding a few dozen events listeners, which threw off the actual performance testing.\r\n\r\nIt's fixed now and everything has similar performance, except for `off` which is dramatically faster.\r\n\r\n- - -\r\n\r\nFor giggles, there's also an implementation using a back-linked array. But, it's much slower at just about everything."}}