payload: {"action":"created","issue":{"url":"https://api.github.com/repos/atom/text-buffer/issues/308","repository_url":"https://api.github.com/repos/atom/text-buffer","labels_url":"https://api.github.com/repos/atom/text-buffer/issues/308/labels{/name}","comments_url":"https://api.github.com/repos/atom/text-buffer/issues/308/comments","events_url":"https://api.github.com/repos/atom/text-buffer/issues/308/events","html_url":"https://github.com/atom/text-buffer/issues/308","id":400969106,"node_id":"MDU6SXNzdWU0MDA5NjkxMDY=","number":308,"title":"TextBuffer makes vim word motion painfully slow in large file","user":{"login":"jedwards1211","id":1448194,"node_id":"MDQ6VXNlcjE0NDgxOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1448194?v=4","gravatar_id":"","url":"https://api.github.com/users/jedwards1211","html_url":"https://github.com/jedwards1211","followers_url":"https://api.github.com/users/jedwards1211/followers","following_url":"https://api.github.com/users/jedwards1211/following{/other_user}","gists_url":"https://api.github.com/users/jedwards1211/gists{/gist_id}","starred_url":"https://api.github.com/users/jedwards1211/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedwards1211/subscriptions","organizations_url":"https://api.github.com/users/jedwards1211/orgs","repos_url":"https://api.github.com/users/jedwards1211/repos","events_url":"https://api.github.com/users/jedwards1211/events{/privacy}","received_events_url":"https://api.github.com/users/jedwards1211/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-01-19T07:03:35Z","updated_at":"2019-02-18T03:28:38Z","closed_at":null,"author_association":"NONE","body":"See https://github.com/t9md/atom-vim-mode-plus/issues/1113.\r\n\r\nBasically, it's `TextBuffer`'s fault.  `TextBuffer.findAllInRangeSync` is going super slow at the beginning of the file.\r\nConsidering this and issues with find in replace in large files being really slow, it's obvious that `TextBuffer` needs some serious improvement.\r\n\r\n---\r\n\r\n*Edit by @rsese to copy the detailed issue description from https://github.com/t9md/atom-vim-mode-plus/issues/1113*\r\n\r\n> Execute `Vim Mode Plus: Clip Debug Info`(which write info to clipboard) then paste here.\r\n> \r\n> debug info\r\n> Read and check all \"Checklist\" below.\r\n> \r\n> # Checklist\r\n> You have to check all before open issue.\r\n> \r\n> * [x]  Provide your environment info clipped by `Vim Mode Plus: Clip Debug Info` command.\r\n> * [x]  Try with latest Atom and latest vim-mode-plus.\r\n> * [x]  Pick a descriptive and non-ambiguous subject\r\n> * [x]  Express \"what\" you want(feature? config option?, behavior change?) in short sentence(not long!).\r\n> * [x]  Contrast current behavior if you want to change current behavior, with sample text, operation(keystroke) and result.\r\n> * [x]  Include real use case so that maintainer can understand \"why\" you need help.\r\n> * [x]  Include Atom(`atom --version`), vim-mode-plus version, and OS version(e.g. macOS Sierra 10.12.3).\r\n> * [x]  If keybinding issue, Read [this](https://github.com/t9md/atom-vim-mode-plus/wiki/IssueReport#some-keybinding-not-working).\r\n> \r\n> Here is an imitation of the data file I'm working with (60k lines):\r\n> [sample-cave-data.txt](https://github.com/t9md/atom-vim-mode-plus/files/2775286/sample-cave-data.txt)\r\n> \r\n> Moving forward by a word (`w` command) at the beginning of the file takes approx 240 ms per jump. Near the end of the file it only takes 1 ms per jump (see profiler output below).\r\n> \r\n> 240 ms is painfully slow. I'd like `w` to take 1 ms everywhere within a file of any size.\r\n> \r\n> Slowness comes from `TextBuffer.findAllInRangeSync`. (`TextBuffer` also makes search and replace performance utterly pathetic in large files, so I don't blame `vim-mode-plus` for this really, thanks for all of your hard work!)\r\n> \r\n> ### Versions\r\n> OS: macOS Mojave 10.14.2\r\n> Atom : 1.34.0\r\n> Electron: 2.0.16\r\n> Chrome : 61.0.3163.100\r\n> Node : 8.9.3\r\n> vim-mode-plus: 1.36.0\r\n> \r\n> ### Saved profiler output\r\n> [vim-mode-plus-slow-word-motion.zip](https://github.com/t9md/atom-vim-mode-plus/files/2775278/vim-mode-plus-slow-word-motion.zip)\r\n> \r\n> ### Profiler screenshot -- start of file\r\n> ![image](https://user-images.githubusercontent.com/1448194/51423305-baca5a00-1b83-11e9-9581-aeb660e4d79a.png)\r\n> \r\n> ### Profiler screenshot -- end of file\r\n> ![image](https://user-images.githubusercontent.com/1448194/51423298-979faa80-1b83-11e9-89fc-96cf9dad047e.png)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/atom/text-buffer/issues/comments/464569126","html_url":"https://github.com/atom/text-buffer/issues/308#issuecomment-464569126","issue_url":"https://api.github.com/repos/atom/text-buffer/issues/308","id":464569126,"node_id":"MDEyOklzc3VlQ29tbWVudDQ2NDU2OTEyNg==","user":{"login":"t9md","id":155205,"node_id":"MDQ6VXNlcjE1NTIwNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/155205?v=4","gravatar_id":"","url":"https://api.github.com/users/t9md","html_url":"https://github.com/t9md","followers_url":"https://api.github.com/users/t9md/followers","following_url":"https://api.github.com/users/t9md/following{/other_user}","gists_url":"https://api.github.com/users/t9md/gists{/gist_id}","starred_url":"https://api.github.com/users/t9md/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/t9md/subscriptions","organizations_url":"https://api.github.com/users/t9md/orgs","repos_url":"https://api.github.com/users/t9md/repos","events_url":"https://api.github.com/users/t9md/events{/privacy}","received_events_url":"https://api.github.com/users/t9md/received_events","type":"User","site_admin":false},"created_at":"2019-02-18T03:28:38Z","updated_at":"2019-02-18T03:28:38Z","author_association":"CONTRIBUTOR","body":"Investigated quickly.\r\nvim-mode-plus depends on `editor.scanInBufferRange` and `editor.backwardsScanInBufferRange` heavily.\r\nThese function call TextBuffer's `scanInRange` internally.  \r\nThe problem is although `scanInBufferRange` accept iterator which stop scanning at the given condition it collects **all** matching entries unnecessarily by calling `findAllInRangeSync`.\r\n\r\nhttps://github.com/atom/text-buffer/blob/master/src/text-buffer.js#L1536\r\n\r\nMaybe I believe the original assumption is `findAllInRangeSync` is fast enough for us to ignore this inefficiency.\r\nBut here, when `scanRange` become very big like 60K lines of buffer.\r\nThis inefficiency becomes significant.\r\nI want text-buffer provide checking iterator line by line instead of preliminarily collect all entries then checking iterator.\r\n\r\nWhat I can come up with to overcome current limitation is to just implement own version of `editor.scanInRange` , but I don't think it is an ideal solution."}}
other: {"actor":{"display_login":"t9md"}}