{"action":"created","issue":{"url":"https://api.github.com/repos/vim/vim/issues/1046","repository_url":"https://api.github.com/repos/vim/vim","labels_url":"https://api.github.com/repos/vim/vim/issues/1046/labels{/name}","comments_url":"https://api.github.com/repos/vim/vim/issues/1046/comments","events_url":"https://api.github.com/repos/vim/vim/issues/1046/events","html_url":"https://github.com/vim/vim/pull/1046","id":175316037,"number":1046,"title":"find_tags: Use a hashtab_T instead of garray_T to collect tag results","user":{"login":"jamessan","id":112971,"avatar_url":"https://avatars.githubusercontent.com/u/112971?v=3","gravatar_id":"","url":"https://api.github.com/users/jamessan","html_url":"https://github.com/jamessan","followers_url":"https://api.github.com/users/jamessan/followers","following_url":"https://api.github.com/users/jamessan/following{/other_user}","gists_url":"https://api.github.com/users/jamessan/gists{/gist_id}","starred_url":"https://api.github.com/users/jamessan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamessan/subscriptions","organizations_url":"https://api.github.com/users/jamessan/orgs","repos_url":"https://api.github.com/users/jamessan/repos","events_url":"https://api.github.com/users/jamessan/events{/privacy}","received_events_url":"https://api.github.com/users/jamessan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-06T18:23:13Z","updated_at":"2016-09-06T19:02:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/vim/vim/pulls/1046","html_url":"https://github.com/vim/vim/pull/1046","diff_url":"https://github.com/vim/vim/pull/1046.diff","patch_url":"https://github.com/vim/vim/pull/1046.patch"},"body":"As discussed in #1044, much of the time currently spent in finding tags\r\nis looking for duplicate tags.  Since the tags are stored in a garray_T,\r\nthis has to perform a linear search of all existing tags every time a\r\nnew tag is added.\r\n\r\nUsing a hashtab_T (with a modified hash function to allow embedded NUL\r\nbytes), the deduplication costs are drastically cheaper.\r\n\r\nComparing the times to find all tags containing the letter a in a tags\r\nfile for all of /usr/include:\r\n\r\n```sh\r\n  $ time ./src/vim.hash -u NONE --cmd 'echo len(taglist(\"a\"))' --cmd q\r\n  115305\r\n  ./src/vim -u NONE --cmd 'echo len(taglist(\"a\"))' --cmd q  0.69s user 0.04s system 98% cpu 0.741 total\r\n  $ time ./src/vim -u NONE --cmd 'echo len(taglist(\"a\"))' --cmd q\r\n  115305\r\n  ./src/vim -u NONE --cmd 'echo len(taglist(\"a\"))' --cmd q  80.69s user 0.08s system 99% cpu 1:20.90 total\r\n```"},"comment":{"url":"https://api.github.com/repos/vim/vim/issues/comments/245055150","html_url":"https://github.com/vim/vim/pull/1046#issuecomment-245055150","issue_url":"https://api.github.com/repos/vim/vim/issues/1046","id":245055150,"user":{"login":"khalidchawtany","id":1681606,"avatar_url":"https://avatars.githubusercontent.com/u/1681606?v=3","gravatar_id":"","url":"https://api.github.com/users/khalidchawtany","html_url":"https://github.com/khalidchawtany","followers_url":"https://api.github.com/users/khalidchawtany/followers","following_url":"https://api.github.com/users/khalidchawtany/following{/other_user}","gists_url":"https://api.github.com/users/khalidchawtany/gists{/gist_id}","starred_url":"https://api.github.com/users/khalidchawtany/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khalidchawtany/subscriptions","organizations_url":"https://api.github.com/users/khalidchawtany/orgs","repos_url":"https://api.github.com/users/khalidchawtany/repos","events_url":"https://api.github.com/users/khalidchawtany/events{/privacy}","received_events_url":"https://api.github.com/users/khalidchawtany/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T19:02:58Z","updated_at":"2016-09-06T19:02:58Z","body":"That is a hell lot faster 😍 "}}
{"actor":{"display_login":"khalidchawtany"}}