madkins/sloggy is a new slog.Handler built from the ground up to generate JSON log records.
While the performance isn't top-tier, this handler adheres faithfully to documented slog.Handler
and observed slog.JSONHandler behavior.
The madkins/flash handler, derived from this one, has better performance.
|
madkins/flash
madkins/sloggy
|
Benchmark |
Runs |
Ns/Op |
Allocs/Op |
Bytes/Op |
MB/Sec |
Score |
Attributes |
425,600 |
2,808.00 |
64 |
1,384 |
159.92 |
77.90 |
Big Group |
6,782 |
172,366.00 |
5,845 |
62,008 |
172.81 |
74.33 |
Disabled |
322,120,028 |
3.73 |
0 |
0 |
0.00 |
96.83 |
Key Values |
367,309 |
2,849.00 |
64 |
1,384 |
157.59 |
77.97 |
Logging |
17,766 |
67,583.00 |
1,865 |
26,992 |
142.22 |
76.89 |
Simple |
1,749,944 |
681.90 |
14 |
240 |
130.52 |
77.71 |
Simple Source |
680,320 |
1,708.00 |
30 |
1,280 |
166.87 |
70.43 |
With Attrs Attributes |
428,588 |
2,801.00 |
64 |
1,384 |
300.28 |
85.36 |
With Attrs Key Values |
427,964 |
2,856.00 |
64 |
1,384 |
294.46 |
85.34 |
With Attrs Simple |
1,742,838 |
690.50 |
14 |
240 |
696.56 |
94.65 |
With Group Attributes |
419,445 |
2,849.00 |
64 |
1,384 |
162.84 |
85.40 |
With Group Key Values |
406,041 |
2,875.00 |
64 |
1,384 |
161.37 |
85.41 |
|