{"action":"created","issue":{"url":"https://api.github.com/repos/DaveDavenport/rofi/issues/238","labels_url":"https://api.github.com/repos/DaveDavenport/rofi/issues/238/labels{/name}","comments_url":"https://api.github.com/repos/DaveDavenport/rofi/issues/238/comments","events_url":"https://api.github.com/repos/DaveDavenport/rofi/issues/238/events","html_url":"https://github.com/DaveDavenport/rofi/pull/238","id":109079655,"number":238,"title":"Filtering speed improvements","user":{"login":"larkery","id":1721963,"avatar_url":"https://avatars.githubusercontent.com/u/1721963?v=3","gravatar_id":"","url":"https://api.github.com/users/larkery","html_url":"https://github.com/larkery","followers_url":"https://api.github.com/users/larkery/followers","following_url":"https://api.github.com/users/larkery/following{/other_user}","gists_url":"https://api.github.com/users/larkery/gists{/gist_id}","starred_url":"https://api.github.com/users/larkery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larkery/subscriptions","organizations_url":"https://api.github.com/users/larkery/orgs","repos_url":"https://api.github.com/users/larkery/repos","events_url":"https://api.github.com/users/larkery/events{/privacy}","received_events_url":"https://api.github.com/users/larkery/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-30T12:48:11Z","updated_at":"2015-09-30T12:50:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DaveDavenport/rofi/pulls/238","html_url":"https://github.com/DaveDavenport/rofi/pull/238","diff_url":"https://github.com/DaveDavenport/rofi/pull/238.diff","patch_url":"https://github.com/DaveDavenport/rofi/pull/238.patch"},"body":"I have been using rofi in place of dmenu, it's very nice but it's quite a lot slower for really long lists of inputs (hence the lazy filter limit I guess).\r\n\r\nHere are two commits which make it a bit more efficient; the first one avoids refiltering the whole list when the input becomes more restrictive (pretty common as you normally add characters on the end). \r\n\r\nThe second avoids repeatedly duplicating and case-folding the input items array every time it is refiltered. This makes some of the code slightly uglier (more state to manage), but it makes it significantly faster.\r\n\r\nI think I have avoided introducing any bugs, but it might be worth checking that I am freeing everything I should be at the relevant places. The additional state is in `struct MenuState` in `rofi.c`, fields `last_matched_tokens` and `case_folded_lines`."},"comment":{"url":"https://api.github.com/repos/DaveDavenport/rofi/issues/comments/144386546","html_url":"https://github.com/DaveDavenport/rofi/pull/238#issuecomment-144386546","issue_url":"https://api.github.com/repos/DaveDavenport/rofi/issues/238","id":144386546,"user":{"login":"larkery","id":1721963,"avatar_url":"https://avatars.githubusercontent.com/u/1721963?v=3","gravatar_id":"","url":"https://api.github.com/users/larkery","html_url":"https://github.com/larkery","followers_url":"https://api.github.com/users/larkery/followers","following_url":"https://api.github.com/users/larkery/following{/other_user}","gists_url":"https://api.github.com/users/larkery/gists{/gist_id}","starred_url":"https://api.github.com/users/larkery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larkery/subscriptions","organizations_url":"https://api.github.com/users/larkery/orgs","repos_url":"https://api.github.com/users/larkery/repos","events_url":"https://api.github.com/users/larkery/events{/privacy}","received_events_url":"https://api.github.com/users/larkery/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T12:50:47Z","updated_at":"2015-09-30T12:50:47Z","body":"Not sure whether my commit has caused the CI build to fail :/"}}