Skip to content

Conversation

@iamdoron
Copy link
Contributor

Hi,

I had some performance issues when using async.cargo with large number of tasks (batches of 10k). Changing splice(0, 1) to shift() improved it dramatically (for a batch of 10k it removed ~3 seconds from each batch).
For some reason I wasn't able to reproduce it using an example. Maybe it depends on the memory state of the process. From a simple benchmark here you can see shift is much faster than splice (I checked on Safari, Chrome & Firefox on MacOS)

@hargasinski
Copy link
Collaborator

Thanks for the PR! The change looks good to me.

@megawac
Copy link
Collaborator

megawac commented Jul 24, 2017

👍 shift is usually an order of magnitude faster than splice(0, 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants