Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Logging isn't free

Logging isn't free

This was a lightning talk at Jozi-JUG.

This repository provides code for benchmarking different kinds of logging statements to quantify the cost of logging.

https://github.com/corneil/logging-is-not-free

Corneil du Plessis

June 24, 2019
Tweet

More Decks by Corneil du Plessis

Other Decks in Programming

Transcript

  1. Benchmark – Log4J 0.00 100000.00 200000.00 300000.00 400000.00 500000.00 600000.00

    700000.00 benchmarkAToString benchmarkFluentWithLazy benchmarkFluentWithParam benchmarkKLogging benchmarkKLoggingCheck benchmarkKLoggingExt benchmarkPlaceHolderToString benchmarkPlaceHolders benchmarkPlaceHoldersNoExt benchmarkPlaceHoldersNoExtCheck benchmarkStringCat benchmarkStringCatToString Log4J Enabled Disabled
  2. Benchmark – Log4J – Logarithmic scale 1.00 100.00 10000.00 1000000.00

    benchmarkAToString benchmarkFluentWithLazy benchmarkFluentWithParam benchmarkKLogging benchmarkKLoggingCheck benchmarkKLoggingExt benchmarkPlaceHolderToString benchmarkPlaceHolders benchmarkPlaceHoldersNoExt benchmarkPlaceHoldersNoExtCheck benchmarkStringCat benchmarkStringCatToString Log4J Enabled Disabled
  3. Benchmark – Log4J - No Fluent 0.00 10000.00 20000.00 30000.00

    40000.00 benchmarkAToString benchmarkKLogging benchmarkKLoggingCheck benchmarkKLoggingExt benchmarkPlaceHolderToString benchmarkPlaceHolders benchmarkPlaceHoldersNoExt benchmarkPlaceHoldersNoExtCheck benchmarkStringCat benchmarkStringCatToString Log4J Enabled Disabled
  4. Benchmark – Log4J – No Fluent – Log Scale 1.00

    100.00 10000.00 benchmarkAToString benchmarkKLogging benchmarkKLoggingCheck benchmarkKLoggingExt benchmarkPlaceHolderToString benchmarkPlaceHolders benchmarkPlaceHoldersNoExt benchmarkPlaceHoldersNoExtCheck benchmarkStringCat benchmarkStringCatToString Log4J Enabled Disabled
  5. Benchmark – Disabled only 0.00 100.00 200.00 300.00 400.00 benchmarkAToString

    benchmarkKLogging benchmarkKLoggingCheck benchmarkKLoggingExt benchmarkPlaceHolderToString benchmarkPlaceHolders benchmarkPlaceHoldersNoExt benchmarkPlaceHoldersNoExtCheck benchmarkStringCat benchmarkStringCatToString Disabled
  6. Benchmark – Disabled only – Log scale 1.00 10.00 100.00

    1000.00 benchmarkAToString benchmarkKLogging benchmarkKLoggingCheck benchmarkKLoggingExt benchmarkPlaceHolderToString benchmarkPlaceHolders benchmarkPlaceHoldersNoExt benchmarkPlaceHoldersNoExtCheck benchmarkStringCat benchmarkStringCatToString Disabled
  7. Benchmark – All loggers - Disabled 0.00 1.00 2.00 3.00

    4.00 5.00 6.00 7.00 8.00 9.00 10.00 benchmarkKLogging benchmarkKLoggingCheck benchmarkKLoggingExt benchmarkPlaceHolders benchmarkPlaceHoldersNoExt benchmarkPlaceHoldersNoExtCheck Disabled JUL LOGBACK LOG4J
  8. Benchmark – All loggers - Enabled 0.00 50000.00 100000.00 150000.00

    benchmarkKLogging benchmarkKLoggingCheck benchmarkKLoggingExt benchmarkPlaceHolderToString benchmarkPlaceHolders benchmarkPlaceHoldersNoExt benchmarkStringCat benchmarkStringCatToString Enabled JUL LOGBACK LOG4J