As array.shift needs to reindex the whole array for each execution, this can be pretty processing expensive if you need to do it in a high frequency.
Though a custom Queue implementation will loose to native array shift in cases where there is not much items to deal with, the difference of time in this cases seems to be irrelevant.
So, it is worth it to use a custom Queue implementation to have a faster and less cpu demanding shift processing.
There is a lot of Queue implementations out there, I just choose one of them with a simple implementation and more array like for this PR.
I changed the package version of mocha from "*" to "^6.0.0" because last versions of mocha doesn't supports v8.x and v10.x of node, so, the configured pipeline would not work
Motivation
As array.shift needs to reindex the whole array for each execution, this can be pretty processing expensive if you need to do it in a high frequency. Though a custom Queue implementation will loose to native array shift in cases where there is not much items to deal with, the difference of time in this cases seems to be irrelevant. So, it is worth it to use a custom Queue implementation to have a faster and less cpu demanding shift processing.
There is a lot of Queue implementations out there, I just choose one of them with a simple implementation and more array like for this PR.