interpolation icon indicating copy to clipboard operation
interpolation copied to clipboard

logger performance warning

Open missinglink opened this issue 6 years ago • 1 comments

Usage of the info or debug level logging when stdout is a TTY results in a ~25% performance hit. This PR simply adds a warning so developers are aware.

stdout is a TTY
    iteration_duration.........: avg=71.83ms min=15.43ms med=70.58ms max=135.37ms p(90)=86.29ms p(95)=92.87ms
    iterations.................: 10000  1388.112538/s

stdout is /dev/null
    iteration_duration.........: avg=55.19ms min=23.44ms med=54.81ms max=81.28ms p(90)=62.97ms p(95)=65.49ms
    iterations.................: 10000  1806.935143/s

missinglink avatar Mar 12 '20 11:03 missinglink

Since this is true everwhere, should we consider putting the warning somewhere in our general documentation?

I'd rather we didn't add code to print this warning, especially in one of the (currently) least performance sensitive Pelias services.

orangejulius avatar Mar 12 '20 16:03 orangejulius