{"action":"created","issue":{"url":"https://api.github.com/repos/emacs-helm/helm/issues/840","labels_url":"https://api.github.com/repos/emacs-helm/helm/issues/840/labels{/name}","comments_url":"https://api.github.com/repos/emacs-helm/helm/issues/840/comments","events_url":"https://api.github.com/repos/emacs-helm/helm/issues/840/events","html_url":"https://github.com/emacs-helm/helm/issues/840","id":55392628,"number":840,"title":"Why does helm-locate work relatively slow for a small number of candidates?","user":{"login":"boykov","id":465489,"avatar_url":"https://avatars.githubusercontent.com/u/465489?v=3","gravatar_id":"","url":"https://api.github.com/users/boykov","html_url":"https://github.com/boykov","followers_url":"https://api.github.com/users/boykov/followers","following_url":"https://api.github.com/users/boykov/following{/other_user}","gists_url":"https://api.github.com/users/boykov/gists{/gist_id}","starred_url":"https://api.github.com/users/boykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boykov/subscriptions","organizations_url":"https://api.github.com/users/boykov/orgs","repos_url":"https://api.github.com/users/boykov/repos","events_url":"https://api.github.com/users/boykov/events{/privacy}","received_events_url":"https://api.github.com/users/boykov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-01-25T02:18:56Z","updated_at":"2015-01-30T16:48:35Z","closed_at":null,"body":"There are two different cases in `helm-locate` behavior:\r\n\r\n1) for example, pattern: **package**\r\n\r\n`helm-locate` begins to show candidates immediately. (Note: `locate -i -e package` gives thousands of candidates.)\r\n\r\n2) pattern: **package.rcp**\r\n\r\n`helm-locate` waits a few seconds and begins to show candidates. (`locate -i -e package.rcp` gives 20+ candidates.)\r\n\r\nI tried different patterns: 2) proceeds to 1) at aproximately 300 candidates. But `anything-locate` works quickly in both cases. How to make `helm-locate` work quickly for a small number of candidates?"},"comment":{"url":"https://api.github.com/repos/emacs-helm/helm/issues/comments/72231218","html_url":"https://github.com/emacs-helm/helm/issues/840#issuecomment-72231218","issue_url":"https://api.github.com/repos/emacs-helm/helm/issues/840","id":72231218,"user":{"login":"thierryvolpiatto","id":1533939,"avatar_url":"https://avatars.githubusercontent.com/u/1533939?v=3","gravatar_id":"","url":"https://api.github.com/users/thierryvolpiatto","html_url":"https://github.com/thierryvolpiatto","followers_url":"https://api.github.com/users/thierryvolpiatto/followers","following_url":"https://api.github.com/users/thierryvolpiatto/following{/other_user}","gists_url":"https://api.github.com/users/thierryvolpiatto/gists{/gist_id}","starred_url":"https://api.github.com/users/thierryvolpiatto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thierryvolpiatto/subscriptions","organizations_url":"https://api.github.com/users/thierryvolpiatto/orgs","repos_url":"https://api.github.com/users/thierryvolpiatto/repos","events_url":"https://api.github.com/users/thierryvolpiatto/events{/privacy}","received_events_url":"https://api.github.com/users/thierryvolpiatto/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T16:48:35Z","updated_at":"2015-01-30T16:48:35Z","body":"\nEvgeny Boykov <notifications@github.com> writes:\n\n> Yes, I have helm and anything in parallel until I get rid of anything\n> completely - but helm-locate breaks my workflow.\n\nhelm-locate is using the default transformer for file and it is probably\nthe culprit, I will look into this ASAP.\n\nThe simple command below should work as you expect:\n(Don't try to jump to a file, I haven't added any action)\n\n(defun helm-anything-locate ()\n  (interactive)\n  (let ((cmd (case system-type\n               ('gnu/linux \"locate -i -r %s\")\n               ('berkeley-unix \"locate -i %s\")\n               ('windows-nt \"es -i -r %s\")\n               (t \"locate %s\"))))\n    (helm :sources (helm-build-async-source \"helm anything locate\"\n                     :candidates-process\n                     (lambda ()\n                       (prog1\n                           (start-process-shell-command \"locate-process\" nil\n                                                        (format cmd helm-pattern))\n                         (set-process-sentinel (get-process \"locate-process\")\n                                               #'(lambda (process event)\n                                                   (when (string= event \"finished\\n\")\n                                                     (with-helm-window\n                                                       (force-mode-line-update nil)\n                                                       (helm-update-move-first-line)))))))\n                     :mode-line helm-generic-file-mode-line-string\n                     :requires-pattern 3))))\n\n-- \nThierry\nGet my Gnupg key:\ngpg --keyserver pgp.mit.edu --recv-keys 59F29997"}}