bench: add logging benchmarks for LogPrintLevel and LogPrintfCategory #25586

pull jonatack wants to merge 4 commits into bitcoin:master from jonatack:add-logging-benchmarks changing 1 files +46 −16
  1. jonatack commented at 11:11 am on July 11, 2022: contributor

    LogPrintLevel and LogPrintfCategory were recently added to the logging macros in #24464 and #25306, respectively. Our logging is expected to primarily use these methods, so it makes sense to benchmark them.

    This pull adds benchmarks for both of them to the logging benchmarks, improves the existing benchmark naming to be clearer and with a more coherent output order, and sorts the benchmark code in that order.

     0$ NANOBENCH_SUPPRESS_WARNINGS=1 ./src/bench/bench_bitcoin -filter=Log*.*
     1
     2before
     3
     4|               ns/op |                op/s |    err% |     total | benchmark
     5|--------------------:|--------------------:|--------:|----------:|:----------
     6|               75.82 |       13,189,445.28 |    5.3% |      0.01 | `LoggingNoCategory`
     7|            1,344.86 |          743,571.82 |   19.8% |      0.01 | `LoggingNoFile`
     8|           15,341.11 |           65,184.34 |   19.6% |      0.01 | `LoggingNoThreadNames`
     9|           22,790.48 |           43,877.96 |   36.3% |      0.01 | `LoggingYoCategory`
    10|           22,972.32 |           43,530.65 |    7.4% |      0.01 | `LoggingYoThreadNames`
    

    after

     0$ NANOBENCH_SUPPRESS_WARNINGS=1 ./src/bench/bench_bitcoin -filter=Log*.*
     1
     2|               ns/op |                op/s |    err% |     total | benchmark
     3|--------------------:|--------------------:|--------:|----------:|:----------
     4|            2,497.81 |          400,349.92 |   25.1% |      0.01 | `LogNoDebugLogFile`
     5|           30,758.83 |           32,510.99 |   18.8% |      0.01 | `LogPrintLevelWithThreadNames`
     6|           25,559.50 |           39,124.40 |    7.1% |      0.01 | `LogPrintLevelWithoutThreadNames`
     7|           22,128.45 |           45,190.70 |    2.2% |      0.01 | `LogPrintWithCategory`
     8|           21,888.91 |           45,685.23 |    6.3% |      0.01 | `LogPrintWithoutCategory`
     9|           28,293.11 |           35,344.29 |    4.9% |      0.01 | `LogPrintfCategoryWithThreadNames`
    10|           24,329.70 |           41,102.03 |    7.3% |      0.01 | `LogPrintfCategoryWithoutThreadNames`
    11|           26,814.71 |           37,292.97 |    6.9% |      0.01 | `LogPrintfWithThreadNames`
    12|           18,139.46 |           55,128.43 |   20.9% |      0.01 | `LogPrintfWithoutThreadNames`
    
  2. bench: add LogPrintfCategory() benchmarks ebc14d5384
  3. bench: add LogPrintLevel() benchmarks 658faa09bf
  4. bench: improve logging benchmark naming for clearer/coherent output 1e5765a743
  5. bench: order the logging benchmark code by output 147f479072
  6. jonatack force-pushed on Jul 11, 2022
  7. jonatack renamed this:
    bench: add logging benchmarks for LogPrintLevel and LogPrintfCategory
    bench: add benchmarks for LogPrintLevel, LogPrintfCategory, and lock contention logging
    on Jul 11, 2022
  8. jonatack force-pushed on Jul 11, 2022
  9. jonatack renamed this:
    bench: add benchmarks for LogPrintLevel, LogPrintfCategory, and lock contention logging
    bench: add logging benchmarks for LogPrintLevel and LogPrintfCategory
    on Jul 11, 2022
  10. DrahtBot added the label Tests on Jul 11, 2022
  11. fanquake commented at 9:29 am on July 20, 2022: member
    ~0 - I’m not really convinced we need more benchmarks for logging code.
  12. jonatack commented at 7:53 pm on August 5, 2022: contributor
    This change makes sense given that the codebase is migrating to these methods but closing for now, will try again later.
  13. jonatack closed this on Aug 5, 2022

  14. bitcoin locked this on Aug 22, 2023


jonatack fanquake

Labels
Tests


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me