Home

Handler Scores

Handlers
Bench Tests
Verify Tests

Scores

Handler Benchmark Warnings
chanchal/zaphandler 88.83 61.54
madkins/flash 94.47 98.46
madkins/replattr 92.46 98.46
madkins/sloggy 82.35 98.46
phsym/zeroslog 98.76 47.69
phuslu/slog 100.00 98.46
samber/slog-logrus 8.29 56.92
samber/slog-zap 54.33 50.77
samber/slog-zerolog 56.12 47.69
slog/JSONHandler 96.09 98.46
svcrunner/jsonlog 98.04 72.31

Numbers are on scale of 0..100. Metrics algorithms completely made up out of thin air. See notes below for details.


Speed vs. Functionality

← Chart Size → Top Right:
Handler Scoring Handler Scoring Handler Scoring Handler Scoring

Higher numbers are better on both axes. The "good" zone is the upper right and the "bad" zone is the lower left.

The top is fast, the bottom is slow. Left is more warnings, right is less.


Scoring Algorithms

The algorithm behind the scores shown on this page are somewhat arbitrary. Many different algorithms could have been used, but after careful thought the one discussed below was considered to be "good enough".

The code for the scoring algorithm was carefully implemented behind an interface. There is currently only one "default" code module and no simple way to replace one scoring algorithm with another, but it wouldn't be hard.

Link to the code for the scoring algorithm.

Benchmarks

Handler benchmarks are scored based on several metrics on each of various tests. Metrics are worth different amounts depending on what they are. The weights applied during this process are shown on the right.

Each combination of handler and test results in a single line of test output:

BenchmarkMadkinsFlash/BenchmarkSimple-8  3547497  327.1 ns/op  284.33 MB/s  24 B/op  1 allocs/op

From this line we get:

  • the handler name (BenchmarkMadkinsFlash),
  • the test name (BenchmarkSimple),
  • the number of test runs (3547497),
  • nanoseconds per operation (327.1 ns/op),
  • memory bytes allocated per operation (24 B/op),
  • memory allocation per operation (1 allocs/op), and
  • estimated logging throughput per second (284.33 MB/s).

For each handler/test combination (single line or test results) we use three results: nanoseconds per operation, memory bytes allocated per operation, and memory allocation per operation. These three items are combined over two steps. First the test value ranges are acquired:

for each test
    for each handler
        for each of the three results described above
            track the highest and lowest value for the test over all handlers

Then the test scores are calculated:

for each handler
    for each test
        scorePerTest starts at zero
        for each of the three results described above
            convert the value to a fraction of
                the range of values for the test from the previous step
            scorePerTest = scorePerTest + weight(result) * 100.0 * the fraction
        scorePerTest /= sum of weight(result)
    scorePerHandler = average of scorePerTest for handler

Where the weight(result) comes from the predefined table shown above and to the right. There is currently no weighting by test, all tests are considered equal.

Data Weight
Nanoseconds 3
Alloc Bytes 2
Allocations 1

Warnings

Handlers are scored based on how few warnings are generated. Warnings are worth different amounts depending on their warning level. The weights applied during this process are shown on the right.

Scoring is done for all handlers at the same time:

for each handler
    score starts at zero
    for each warning level
        for each warning in level
            if warning shows up during testing
                score = score + weight(level) * len(warnings)
                adjust score to range of
                    zero to maximum possible number of warnings

Where the weight(level) comes from the predefined table shown above and to the right.

The scores for each handler are then divided by the maximum possible number of warnings that any handler might receive (if it were really awful) and that number is subtracted from 100.0. This results in a number from 0.0 (awful, all warnings logged) to 100.0 (no warnings at all). That number is stored for use and displayed on this page and on each handler page.

Note that most scores are above ~40 as it is difficult to throw all the warnings.

Level Weight
Required 8
Implied 4
Suggested 2
Administrative 1