{"action":"created","issue":{"url":"https://api.github.com/repos/juditacs/wordcount/issues/80","repository_url":"https://api.github.com/repos/juditacs/wordcount","labels_url":"https://api.github.com/repos/juditacs/wordcount/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/juditacs/wordcount/issues/80/comments","events_url":"https://api.github.com/repos/juditacs/wordcount/issues/80/events","html_url":"https://github.com/juditacs/wordcount/issues/80","id":147791771,"number":80,"title":"Memory usage of Bash isn't comparable to rest","user":{"login":"hansbogert","id":2630900,"avatar_url":"https://avatars.githubusercontent.com/u/2630900?v=3","gravatar_id":"","url":"https://api.github.com/users/hansbogert","html_url":"https://github.com/hansbogert","followers_url":"https://api.github.com/users/hansbogert/followers","following_url":"https://api.github.com/users/hansbogert/following{/other_user}","gists_url":"https://api.github.com/users/hansbogert/gists{/gist_id}","starred_url":"https://api.github.com/users/hansbogert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hansbogert/subscriptions","organizations_url":"https://api.github.com/users/hansbogert/orgs","repos_url":"https://api.github.com/users/hansbogert/repos","events_url":"https://api.github.com/users/hansbogert/events{/privacy}","received_events_url":"https://api.github.com/users/hansbogert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-12T15:42:10Z","updated_at":"2016-04-12T20:43:26Z","closed_at":null,"body":"I think the memory usage as shown in the overview page is not comparable to other languages.\r\n\r\nThe bash script fork to different processes many times by piping outputs to other binaries. I think the memory usage of those separate processes is not accounted for."},"comment":{"url":"https://api.github.com/repos/juditacs/wordcount/issues/comments/209094393","html_url":"https://github.com/juditacs/wordcount/issues/80#issuecomment-209094393","issue_url":"https://api.github.com/repos/juditacs/wordcount/issues/80","id":209094393,"user":{"login":"svanoort","id":5400948,"avatar_url":"https://avatars.githubusercontent.com/u/5400948?v=3","gravatar_id":"","url":"https://api.github.com/users/svanoort","html_url":"https://github.com/svanoort","followers_url":"https://api.github.com/users/svanoort/followers","following_url":"https://api.github.com/users/svanoort/following{/other_user}","gists_url":"https://api.github.com/users/svanoort/gists{/gist_id}","starred_url":"https://api.github.com/users/svanoort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svanoort/subscriptions","organizations_url":"https://api.github.com/users/svanoort/orgs","repos_url":"https://api.github.com/users/svanoort/repos","events_url":"https://api.github.com/users/svanoort/events{/privacy}","received_events_url":"https://api.github.com/users/svanoort/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T20:43:26Z","updated_at":"2016-04-12T20:43:26Z","body":"Perhaps, but the larger problem there is that the sort command is actually implemented using an external sort (partitioning the data and sorting in temp files) rather than a fully in-memory sort as with all other implementations.  This enables it to run on very large data sets with minimal memory use (just an index), but makes it extremely slow in comparison and highly dependent on I/O performance.  \r\n\r\nAll other operations in that pipeline can operate on a line at a time with minimal memory use. \r\n\r\nI've got a PR in WIP state that partially addresses this by using the -S 40% option to specify a percentage of physical memory to use in buffering data for sorting - https://github.com/juditacs/wordcount/pull/75"}}