{"action":"created","issue":{"url":"https://api.github.com/repos/openannotation/xpath-range/issues/9","labels_url":"https://api.github.com/repos/openannotation/xpath-range/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/openannotation/xpath-range/issues/9/comments","events_url":"https://api.github.com/repos/openannotation/xpath-range/issues/9/events","html_url":"https://github.com/openannotation/xpath-range/pull/9","id":72295262,"number":9,"title":"Range performance fixes","user":{"login":"wjt","id":86760,"avatar_url":"https://avatars.githubusercontent.com/u/86760?v=3","gravatar_id":"","url":"https://api.github.com/users/wjt","html_url":"https://github.com/wjt","followers_url":"https://api.github.com/users/wjt/followers","following_url":"https://api.github.com/users/wjt/following{/other_user}","gists_url":"https://api.github.com/users/wjt/gists{/gist_id}","starred_url":"https://api.github.com/users/wjt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjt/subscriptions","organizations_url":"https://api.github.com/users/wjt/orgs","repos_url":"https://api.github.com/users/wjt/repos","events_url":"https://api.github.com/users/wjt/events{/privacy}","received_events_url":"https://api.github.com/users/wjt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-30T22:13:13Z","updated_at":"2015-05-01T07:40:55Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openannotation/xpath-range/pulls/9","html_url":"https://github.com/openannotation/xpath-range/pull/9","diff_url":"https://github.com/openannotation/xpath-range/pull/9.diff","patch_url":"https://github.com/openannotation/xpath-range/pull/9.patch"},"body":"I'm using Annotator on pages with really large tables, highlighting potentially thousands of rows of text. Selecting any amount of text which spans more than one row was extremely expensive. `NormalizedRange#limit` and `#getTextNodes` were the main culprits according to Chrome's profiler. These patches make them an order of magnitude faster for me.\r\n\r\nHappy to write more tests if you're not convinced that this new logic is right! Also, the existing code is inconsistent in whether it uses `$.contains` or `util.contains`; shout if there's some hidden reason to use one or the other that I've not seen.\r\n\r\nAgh, while writing this pull request I've noticed that I introduced a use of `childNodes` in `#limit` -- based on the comment in `#getTextNodes` I guess I need to remove that for IE9's sake."},"comment":{"url":"https://api.github.com/repos/openannotation/xpath-range/issues/comments/98066873","html_url":"https://github.com/openannotation/xpath-range/pull/9#issuecomment-98066873","issue_url":"https://api.github.com/repos/openannotation/xpath-range/issues/9","id":98066873,"user":{"login":"wjt","id":86760,"avatar_url":"https://avatars.githubusercontent.com/u/86760?v=3","gravatar_id":"","url":"https://api.github.com/users/wjt","html_url":"https://github.com/wjt","followers_url":"https://api.github.com/users/wjt/followers","following_url":"https://api.github.com/users/wjt/following{/other_user}","gists_url":"https://api.github.com/users/wjt/gists{/gist_id}","starred_url":"https://api.github.com/users/wjt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjt/subscriptions","organizations_url":"https://api.github.com/users/wjt/orgs","repos_url":"https://api.github.com/users/wjt/repos","events_url":"https://api.github.com/users/wjt/events{/privacy}","received_events_url":"https://api.github.com/users/wjt/received_events","type":"User","site_admin":false},"created_at":"2015-05-01T07:40:55Z","updated_at":"2015-05-01T07:40:55Z","body":"(Let me know if you would like the intermediate patches squashed away.))"}}