fluent / fluent-logger-node

A structured logger for Fluentd (Node.js)
Apache License 2.0
259 stars 83 forks source link

Proposing the use of custom Queue implementation for message event mode #174

Open Farenheith opened 4 years ago

Farenheith commented 4 years ago

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.

Farenheith commented 4 years ago

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