{"action":"created","issue":{"url":"https://api.github.com/repos/onivim/oni/issues/2405","repository_url":"https://api.github.com/repos/onivim/oni","labels_url":"https://api.github.com/repos/onivim/oni/issues/2405/labels{/name}","comments_url":"https://api.github.com/repos/onivim/oni/issues/2405/comments","events_url":"https://api.github.com/repos/onivim/oni/issues/2405/events","html_url":"https://github.com/onivim/oni/issues/2405","id":338778773,"node_id":"MDU6SXNzdWUzMzg3Nzg3NzM=","number":2405,"title":"Performance - QuickOpen: Slow search performance in large repository","user":{"login":"bryphe","id":13532591,"node_id":"MDQ6VXNlcjEzNTMyNTkx","avatar_url":"https://avatars1.githubusercontent.com/u/13532591?v=4","gravatar_id":"","url":"https://api.github.com/users/bryphe","html_url":"https://github.com/bryphe","followers_url":"https://api.github.com/users/bryphe/followers","following_url":"https://api.github.com/users/bryphe/following{/other_user}","gists_url":"https://api.github.com/users/bryphe/gists{/gist_id}","starred_url":"https://api.github.com/users/bryphe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryphe/subscriptions","organizations_url":"https://api.github.com/users/bryphe/orgs","repos_url":"https://api.github.com/users/bryphe/repos","events_url":"https://api.github.com/users/bryphe/events{/privacy}","received_events_url":"https://api.github.com/users/bryphe/received_events","type":"User","site_admin":false},"labels":[{"id":827718167,"node_id":"MDU6TGFiZWw4Mjc3MTgxNjc=","url":"https://api.github.com/repos/onivim/oni/labels/insider","name":"insider","color":"1d76db","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-06T01:55:24Z","updated_at":"2018-08-22T04:12:12Z","closed_at":null,"author_association":"COLLABORATOR","body":"<!-- Want this issue prioritized? Please consider supporting the project and becoming an insider!\r\n👉  https://www.onivim.io/Insiders -->\r\n\r\n**Oni Version:** 0.3.6\r\n**Operating System:** Windows\r\n\r\n**Issue:** \r\n\r\nThe QuickOpen experience is slow in this project (on my machine): https://github.com/esy/esy. It does have quite a few files, especially if you bring in submodules (`git submodule update --init --recursive`). But this might be related to some of the slowdowns users have reported on large projects w/ QuickOpen.\r\n\r\nIt's kinda hard to see here, because the `KeyDisplayer` also stalls, but I'm continuously typing after `esya`:\r\n![quickopen-stall](https://user-images.githubusercontent.com/13532591/42355649-040c706e-8083-11e8-8aad-d1af841ae3e4.gif)\r\n\r\n**Steps to reproduce:**\r\n\r\n- `git clone https://github.com/esy/esy`\r\n- `git submodulate init --update --recursive`\r\n- `oni esy`\r\n- `<C-p>`\r\n- `esyajaigoa`\r\n\r\nI also grabbed a profile:\r\n[performance-profile.zip](https://github.com/onivim/oni/files/2168763/performance-profile.zip)\r\n\r\nLooks like the bottleneck is definitely on the javascript side:\r\n![image](https://user-images.githubusercontent.com/13532591/42355724-5e6b160a-8083-11e8-9b1f-6a562edddcaf.png)\r\n\r\nI think it might be here:\r\n```\r\nexport const processSearchTerm = (\r\n    searchString: string,\r\n    options: Oni.Menu.MenuOption[],\r\n    isCaseSensitive: boolean,\r\n): Oni.Menu.MenuOption[] => {\r\n    const filterRegExp = new RegExp(\".*\" + searchString.split(\"\").join(\".*\") + \".*\")\r\n\r\n    return options.filter(f => {\r\n        let textToFilterOn = f.detail + f.label\r\n\r\n        if (!isCaseSensitive) {\r\n            textToFilterOn = textToFilterOn.toLowerCase()\r\n        }\r\n\r\n        return textToFilterOn.match(filterRegExp)\r\n    })\r\n}\r\n```\r\n\r\nThe regexp matching might be expensive, for a large amount of items. We could try doing a cheaper prune first potentially.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/onivim/oni/issues/comments/414904512","html_url":"https://github.com/onivim/oni/issues/2405#issuecomment-414904512","issue_url":"https://api.github.com/repos/onivim/oni/issues/2405","id":414904512,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDkwNDUxMg==","user":{"login":"asa","id":96153,"node_id":"MDQ6VXNlcjk2MTUz","avatar_url":"https://avatars1.githubusercontent.com/u/96153?v=4","gravatar_id":"","url":"https://api.github.com/users/asa","html_url":"https://github.com/asa","followers_url":"https://api.github.com/users/asa/followers","following_url":"https://api.github.com/users/asa/following{/other_user}","gists_url":"https://api.github.com/users/asa/gists{/gist_id}","starred_url":"https://api.github.com/users/asa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asa/subscriptions","organizations_url":"https://api.github.com/users/asa/orgs","repos_url":"https://api.github.com/users/asa/repos","events_url":"https://api.github.com/users/asa/events{/privacy}","received_events_url":"https://api.github.com/users/asa/received_events","type":"User","site_admin":false},"created_at":"2018-08-22T04:12:12Z","updated_at":"2018-08-22T04:12:12Z","author_association":"NONE","body":"with vim I use fzf.vim and ag(silver searcher) as the executable. Its amazingly fast on our huge monorepo.  I hope we can get this working in oni.\r\n\r\n```\" The Silver Searcher\r\nif executable('ag')\r\n  \" Use ag over grep\r\n  set grepprg=ag\\ --nogroup\\ --nocolor\r\n\r\n  \" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore\r\n  let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden  -g \"\"'\r\nendif\r\n```"}}
{"actor":{"display_login":"asa"}}