{"action":"created","issue":{"url":"https://api.github.com/repos/caolan/async/issues/756","labels_url":"https://api.github.com/repos/caolan/async/issues/756/labels{/name}","comments_url":"https://api.github.com/repos/caolan/async/issues/756/comments","events_url":"https://api.github.com/repos/caolan/async/issues/756/events","html_url":"https://github.com/caolan/async/issues/756","id":77711052,"number":756,"title":"async.queue performance suffers greatly with large queues","user":{"login":"bbrowning","id":56071,"avatar_url":"https://avatars.githubusercontent.com/u/56071?v=3","gravatar_id":"","url":"https://api.github.com/users/bbrowning","html_url":"https://github.com/bbrowning","followers_url":"https://api.github.com/users/bbrowning/followers","following_url":"https://api.github.com/users/bbrowning/following{/other_user}","gists_url":"https://api.github.com/users/bbrowning/gists{/gist_id}","starred_url":"https://api.github.com/users/bbrowning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bbrowning/subscriptions","organizations_url":"https://api.github.com/users/bbrowning/orgs","repos_url":"https://api.github.com/users/bbrowning/repos","events_url":"https://api.github.com/users/bbrowning/events{/privacy}","received_events_url":"https://api.github.com/users/bbrowning/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/caolan/async/labels/performance","name":"performance","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-18T16:03:53Z","updated_at":"2015-05-20T14:47:37Z","closed_at":null,"body":"While performance testing a library that uses async.queue, I noticed that the performance of async.queue degrades massively as the number of items in the queue increases. After a certain point, V8 spends so much time shuffling memory around that the performance of everything else slows to a crawl.\r\n\r\nThe culprit appears to be how the current implementation calls `shift` on the tasks array every time an item is processed. I prototyped an alternate implementation that maintains an index into the array and performance is vastly improved with larger queue sizes. For the purposes of this testing, the entire async.queue implementation was copied and modified to form a new async.indexedQueue function so side-by-side comparison could be easily done.\r\n\r\nhttps://gist.github.com/bbrowning/b7355b731eb025608228"},"comment":{"url":"https://api.github.com/repos/caolan/async/issues/comments/103912744","html_url":"https://github.com/caolan/async/issues/756#issuecomment-103912744","issue_url":"https://api.github.com/repos/caolan/async/issues/756","id":103912744,"user":{"login":"smartmouse","id":4519627,"avatar_url":"https://avatars.githubusercontent.com/u/4519627?v=3","gravatar_id":"","url":"https://api.github.com/users/smartmouse","html_url":"https://github.com/smartmouse","followers_url":"https://api.github.com/users/smartmouse/followers","following_url":"https://api.github.com/users/smartmouse/following{/other_user}","gists_url":"https://api.github.com/users/smartmouse/gists{/gist_id}","starred_url":"https://api.github.com/users/smartmouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smartmouse/subscriptions","organizations_url":"https://api.github.com/users/smartmouse/orgs","repos_url":"https://api.github.com/users/smartmouse/repos","events_url":"https://api.github.com/users/smartmouse/events{/privacy}","received_events_url":"https://api.github.com/users/smartmouse/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T14:47:37Z","updated_at":"2015-05-20T14:47:37Z","body":"May I ask if this problem is specific to the v0.12 version? and not 10.x?\r\nThanks"}}