{"action":"created","issue":{"url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2007","labels_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2007/labels{/name}","comments_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2007/comments","events_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2007/events","html_url":"https://github.com/fish-shell/fish-shell/issues/2007","id":65970637,"number":2007,"title":"Example of slowness compared to Bash (while or test problem?)","user":{"login":"alphapapa","id":601365,"avatar_url":"https://avatars.githubusercontent.com/u/601365?v=3","gravatar_id":"","url":"https://api.github.com/users/alphapapa","html_url":"https://github.com/alphapapa","followers_url":"https://api.github.com/users/alphapapa/followers","following_url":"https://api.github.com/users/alphapapa/following{/other_user}","gists_url":"https://api.github.com/users/alphapapa/gists{/gist_id}","starred_url":"https://api.github.com/users/alphapapa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphapapa/subscriptions","organizations_url":"https://api.github.com/users/alphapapa/orgs","repos_url":"https://api.github.com/users/alphapapa/repos","events_url":"https://api.github.com/users/alphapapa/events{/privacy}","received_events_url":"https://api.github.com/users/alphapapa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/fish-shell/fish-shell/milestones/4","html_url":"https://github.com/fish-shell/fish-shell/milestones/fish-future","labels_url":"https://api.github.com/repos/fish-shell/fish-shell/milestones/4/labels","id":130257,"number":4,"title":"fish-future","description":"These are bugs that are not targeted for an upcoming release. After a release, we will reexamine these bugs and pull any in that we think are good targets.\r\n\r\nIf you can provide a fix for a bug in this milestone, we'll generally accept it for the next release even if the bug is not in the release.","creator":{"login":"ridiculousfish","id":920838,"avatar_url":"https://avatars.githubusercontent.com/u/920838?v=3","gravatar_id":"","url":"https://api.github.com/users/ridiculousfish","html_url":"https://github.com/ridiculousfish","followers_url":"https://api.github.com/users/ridiculousfish/followers","following_url":"https://api.github.com/users/ridiculousfish/following{/other_user}","gists_url":"https://api.github.com/users/ridiculousfish/gists{/gist_id}","starred_url":"https://api.github.com/users/ridiculousfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ridiculousfish/subscriptions","organizations_url":"https://api.github.com/users/ridiculousfish/orgs","repos_url":"https://api.github.com/users/ridiculousfish/repos","events_url":"https://api.github.com/users/ridiculousfish/events{/privacy}","received_events_url":"https://api.github.com/users/ridiculousfish/received_events","type":"User","site_admin":false},"open_issues":406,"closed_issues":72,"state":"open","created_at":"2012-06-11T02:25:13Z","updated_at":"2015-04-02T19:41:16Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-04-02T17:13:49Z","updated_at":"2015-04-02T19:53:26Z","closed_at":null,"body":"This is relatively quick:\r\n```\r\nlocate $HOME | bash -c 'while read dir; do [[ -d $dir ]] && echo $dir; done'\r\n```\r\nBut this is painfully slow:\r\n```\r\nfunction onlyDirs\r\n    while read dir\r\n        test -d $dir; and echo $dir\r\n    end\r\nend\r\n\r\nlocate $HOME | onlyDirs\r\n```"},"comment":{"url":"https://api.github.com/repos/fish-shell/fish-shell/issues/comments/89024972","html_url":"https://github.com/fish-shell/fish-shell/issues/2007#issuecomment-89024972","issue_url":"https://api.github.com/repos/fish-shell/fish-shell/issues/2007","id":89024972,"user":{"login":"ridiculousfish","id":920838,"avatar_url":"https://avatars.githubusercontent.com/u/920838?v=3","gravatar_id":"","url":"https://api.github.com/users/ridiculousfish","html_url":"https://github.com/ridiculousfish","followers_url":"https://api.github.com/users/ridiculousfish/followers","following_url":"https://api.github.com/users/ridiculousfish/following{/other_user}","gists_url":"https://api.github.com/users/ridiculousfish/gists{/gist_id}","starred_url":"https://api.github.com/users/ridiculousfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ridiculousfish/subscriptions","organizations_url":"https://api.github.com/users/ridiculousfish/orgs","repos_url":"https://api.github.com/users/ridiculousfish/repos","events_url":"https://api.github.com/users/ridiculousfish/events{/privacy}","received_events_url":"https://api.github.com/users/ridiculousfish/received_events","type":"User","site_admin":false},"created_at":"2015-04-02T19:53:26Z","updated_at":"2015-04-02T19:53:26Z","body":"Ha ha ha, that's because `builtin_read` reads one byte at a time in the non-interactive case: https://github.com/fish-shell/fish-shell/blob/900a8a140896fbac4c0b6215560ef620322634d2/builtin.cpp#L2756 It was that way in fish 1.x too."}}