add benchmark for Logger.WithContext
Change-Id: I5fa58863d236b88cdca6e262a08cde051258b7b4
Reviewed-on: https://go-review.googlesource.com/c/exp/+/447963
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
diff --git a/slog/benchmarks/benchmarks_test.go b/slog/benchmarks/benchmarks_test.go
index 39f3192..a12b2e9 100644
--- a/slog/benchmarks/benchmarks_test.go
+++ b/slog/benchmarks/benchmarks_test.go
@@ -5,6 +5,7 @@
package benchmarks
import (
+ "context"
"io"
"testing"
@@ -16,6 +17,7 @@
// reduces measured allocations.
func BenchmarkAttrs(b *testing.B) {
+ ctx := context.Background()
for _, handler := range []struct {
name string
h slog.Handler
@@ -49,6 +51,18 @@
},
},
{
+ "5 args ctx",
+ func() {
+ logger.WithContext(ctx).LogAttrs(slog.InfoLevel, TestMessage,
+ slog.String("string", TestString),
+ slog.Int("status", TestInt),
+ slog.Duration("duration", TestDuration),
+ slog.Time("time", TestTime),
+ slog.Any("error", TestError),
+ )
+ },
+ },
+ {
"10 args",
func() {
logger.LogAttrs(slog.InfoLevel, TestMessage,
diff --git a/slog/benchmarks/slog-pc.bench b/slog/benchmarks/slog-pc.bench
index c4372f7..2787585 100644
--- a/slog/benchmarks/slog-pc.bench
+++ b/slog/benchmarks/slog-pc.bench
@@ -2,80 +2,105 @@
goarch: amd64
pkg: golang.org/x/exp/slog/benchmarks
cpu: Intel(R) Xeon(R) CPU @ 2.20GHz
-BenchmarkAttrs/disabled/5_args-8 100000000 10.97 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/5_args-8 100000000 11.03 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/5_args-8 100000000 10.83 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/5_args-8 97441850 10.84 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/5_args-8 95607450 10.82 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/10_args-8 62498384 18.88 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/10_args-8 61121353 18.86 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/10_args-8 62246416 18.88 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/10_args-8 60799956 18.89 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/10_args-8 59061819 18.88 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/40_args-8 18597520 64.12 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/40_args-8 18031036 64.39 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/40_args-8 18696117 63.94 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/40_args-8 18752000 63.81 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/40_args-8 18493252 63.88 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/async_discard/5_args-8 3089053 402.2 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/async_discard/5_args-8 3071889 389.2 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/async_discard/5_args-8 3114163 386.9 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/async_discard/5_args-8 3103900 386.4 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/async_discard/5_args-8 3092712 385.4 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/async_discard/10_args-8 1747160 695.9 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/10_args-8 1705131 696.5 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/10_args-8 1718131 689.8 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/10_args-8 1705776 706.5 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/10_args-8 1695583 704.3 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/40_args-8 462394 2350 ns/op 1408 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/40_args-8 495303 2381 ns/op 1408 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/40_args-8 535171 2326 ns/op 1408 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/40_args-8 457449 2331 ns/op 1408 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/40_args-8 540910 2323 ns/op 1408 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/5_args-8 2504246 487.5 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/fastText_discard/5_args-8 2470434 492.9 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/fastText_discard/5_args-8 2494670 484.9 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/fastText_discard/5_args-8 2475620 487.3 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/fastText_discard/5_args-8 2399865 498.9 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/fastText_discard/10_args-8 1257261 946.4 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/10_args-8 1279915 929.7 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/10_args-8 1272433 935.2 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/10_args-8 1000000 1002 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/10_args-8 1243527 975.8 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/40_args-8 365814 3315 ns/op 1413 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/40_args-8 336776 3290 ns/op 1412 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/40_args-8 354438 3241 ns/op 1412 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/40_args-8 377692 3275 ns/op 1413 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/40_args-8 326116 3290 ns/op 1412 B/op 1 allocs/op
-BenchmarkAttrs/Text_discard/5_args-8 988131 1076 ns/op 8 B/op 2 allocs/op
-BenchmarkAttrs/Text_discard/5_args-8 983840 1042 ns/op 8 B/op 2 allocs/op
-BenchmarkAttrs/Text_discard/5_args-8 1000000 1028 ns/op 8 B/op 2 allocs/op
-BenchmarkAttrs/Text_discard/5_args-8 990825 1064 ns/op 8 B/op 2 allocs/op
-BenchmarkAttrs/Text_discard/5_args-8 1000000 1028 ns/op 8 B/op 2 allocs/op
-BenchmarkAttrs/Text_discard/10_args-8 741379 1727 ns/op 224 B/op 5 allocs/op
-BenchmarkAttrs/Text_discard/10_args-8 768871 1736 ns/op 224 B/op 5 allocs/op
-BenchmarkAttrs/Text_discard/10_args-8 712422 1726 ns/op 224 B/op 5 allocs/op
-BenchmarkAttrs/Text_discard/10_args-8 761432 1715 ns/op 224 B/op 5 allocs/op
-BenchmarkAttrs/Text_discard/10_args-8 768960 1743 ns/op 224 B/op 5 allocs/op
-BenchmarkAttrs/Text_discard/40_args-8 224613 5627 ns/op 1477 B/op 17 allocs/op
-BenchmarkAttrs/Text_discard/40_args-8 226648 5848 ns/op 1477 B/op 17 allocs/op
-BenchmarkAttrs/Text_discard/40_args-8 212464 5621 ns/op 1477 B/op 17 allocs/op
-BenchmarkAttrs/Text_discard/40_args-8 219996 5690 ns/op 1477 B/op 17 allocs/op
-BenchmarkAttrs/Text_discard/40_args-8 198876 5662 ns/op 1477 B/op 17 allocs/op
-BenchmarkAttrs/JSON_discard/5_args-8 1322396 876.7 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/JSON_discard/5_args-8 1359752 940.1 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/JSON_discard/5_args-8 1297011 918.5 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/JSON_discard/5_args-8 1387628 882.2 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/JSON_discard/5_args-8 1382520 892.2 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/JSON_discard/10_args-8 826593 1558 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/10_args-8 815361 1554 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/10_args-8 829800 1551 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/10_args-8 854877 1539 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/10_args-8 835476 1563 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/40_args-8 257505 5145 ns/op 1411 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/40_args-8 231441 5103 ns/op 1412 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/40_args-8 236878 5033 ns/op 1412 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/40_args-8 230604 4987 ns/op 1412 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/40_args-8 231382 5082 ns/op 1412 B/op 1 allocs/op
+BenchmarkAttrs/disabled/5_args-8 100000000 11.01 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args-8 100000000 10.98 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args-8 100000000 11.06 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args-8 100000000 10.94 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args-8 100000000 10.96 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args_ctx-8 99092853 11.01 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args_ctx-8 100000000 11.25 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args_ctx-8 100000000 11.02 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args_ctx-8 100000000 11.12 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args_ctx-8 92644926 11.11 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/10_args-8 56434416 19.35 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/10_args-8 61031977 19.12 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/10_args-8 61348626 20.74 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/10_args-8 61096641 19.15 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/10_args-8 60736203 19.10 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/40_args-8 18585967 64.48 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/40_args-8 18430046 64.39 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/40_args-8 18544654 64.53 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/40_args-8 18481387 64.64 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/40_args-8 18459106 64.40 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args-8 3042543 395.5 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args-8 2997498 403.4 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args-8 3029053 395.5 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args-8 2922511 395.0 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args-8 3040330 394.7 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args_ctx-8 3034948 409.1 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args_ctx-8 3025192 396.0 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args_ctx-8 3051126 395.9 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args_ctx-8 3020608 396.3 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args_ctx-8 3033238 395.5 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/10_args-8 1702170 704.5 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/10_args-8 1683478 701.1 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/10_args-8 1668967 705.1 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/10_args-8 1664659 711.6 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/10_args-8 1710505 712.6 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/40_args-8 536484 2360 ns/op 1408 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/40_args-8 515458 2392 ns/op 1408 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/40_args-8 536326 2361 ns/op 1408 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/40_args-8 524487 2394 ns/op 1408 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/40_args-8 526851 2385 ns/op 1408 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/5_args-8 2493134 476.9 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args-8 2480722 483.7 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args-8 2464448 485.8 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args-8 2462064 488.8 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args-8 2435934 479.5 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args_ctx-8 2467768 486.2 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args_ctx-8 2481487 487.1 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args_ctx-8 2473843 499.9 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args_ctx-8 2462508 487.9 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args_ctx-8 2468150 482.7 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/10_args-8 1286020 926.2 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/10_args-8 1288137 952.8 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/10_args-8 1281404 934.2 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/10_args-8 1271204 944.3 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/10_args-8 1295236 929.1 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/40_args-8 360975 3248 ns/op 1412 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/40_args-8 349827 3260 ns/op 1413 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/40_args-8 373995 3306 ns/op 1413 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/40_args-8 345276 3219 ns/op 1412 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/40_args-8 374112 3284 ns/op 1413 B/op 1 allocs/op
+BenchmarkAttrs/Text_discard/5_args-8 1000000 1067 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args-8 1000000 1066 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args-8 1000000 1080 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args-8 988404 1087 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args-8 1000000 1041 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args_ctx-8 1000000 1113 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args_ctx-8 1000000 1089 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args_ctx-8 1000000 1142 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args_ctx-8 1000000 1115 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args_ctx-8 971776 1096 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/10_args-8 743016 1713 ns/op 224 B/op 5 allocs/op
+BenchmarkAttrs/Text_discard/10_args-8 688854 1740 ns/op 224 B/op 5 allocs/op
+BenchmarkAttrs/Text_discard/10_args-8 708565 1762 ns/op 224 B/op 5 allocs/op
+BenchmarkAttrs/Text_discard/10_args-8 748605 1706 ns/op 224 B/op 5 allocs/op
+BenchmarkAttrs/Text_discard/10_args-8 709474 1759 ns/op 224 B/op 5 allocs/op
+BenchmarkAttrs/Text_discard/40_args-8 236040 5644 ns/op 1477 B/op 17 allocs/op
+BenchmarkAttrs/Text_discard/40_args-8 222492 5453 ns/op 1477 B/op 17 allocs/op
+BenchmarkAttrs/Text_discard/40_args-8 220213 5867 ns/op 1477 B/op 17 allocs/op
+BenchmarkAttrs/Text_discard/40_args-8 207702 5686 ns/op 1477 B/op 17 allocs/op
+BenchmarkAttrs/Text_discard/40_args-8 220738 5645 ns/op 1477 B/op 17 allocs/op
+BenchmarkAttrs/JSON_discard/5_args-8 1363849 898.6 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args-8 1335759 865.5 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args-8 1270100 925.2 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args-8 1355726 862.5 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args-8 1241948 925.0 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args_ctx-8 1311213 849.4 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args_ctx-8 1379370 956.9 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args_ctx-8 1276497 888.0 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args_ctx-8 1353361 923.2 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args_ctx-8 1378537 887.3 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/10_args-8 822774 1655 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/10_args-8 678620 1558 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/10_args-8 831974 1508 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/10_args-8 786314 1480 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/10_args-8 899043 1508 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/40_args-8 248425 5033 ns/op 1412 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/40_args-8 242430 5039 ns/op 1412 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/40_args-8 234417 5039 ns/op 1412 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/40_args-8 242533 5150 ns/op 1412 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/40_args-8 237020 5171 ns/op 1412 B/op 1 allocs/op
PASS
-ok golang.org/x/exp/slog/benchmarks 107.152s
+ok golang.org/x/exp/slog/benchmarks 147.035s
diff --git a/slog/benchmarks/slog.bench b/slog/benchmarks/slog.bench
index 0b58079..33ce0cb 100644
--- a/slog/benchmarks/slog.bench
+++ b/slog/benchmarks/slog.bench
@@ -2,80 +2,105 @@
goarch: amd64
pkg: golang.org/x/exp/slog/benchmarks
cpu: Intel(R) Xeon(R) CPU @ 2.20GHz
-BenchmarkAttrs/disabled/5_args-8 100000000 10.86 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/5_args-8 100000000 10.84 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/5_args-8 100000000 10.83 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/5_args-8 100000000 10.85 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/5_args-8 96611278 10.84 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/10_args-8 57230637 18.90 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/10_args-8 62919320 18.88 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/10_args-8 60301082 19.08 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/10_args-8 61005656 19.00 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/10_args-8 60954086 18.90 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/40_args-8 18576979 63.79 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/40_args-8 18501492 63.94 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/40_args-8 18704040 63.76 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/40_args-8 18194610 63.67 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/disabled/40_args-8 18648174 63.85 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/async_discard/5_args-8 13214536 89.16 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/async_discard/5_args-8 14343093 85.63 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/async_discard/5_args-8 13142229 88.27 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/async_discard/5_args-8 13435146 87.02 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/async_discard/5_args-8 13708140 88.69 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/async_discard/10_args-8 4533420 280.7 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/10_args-8 4527133 274.6 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/10_args-8 4155231 283.7 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/10_args-8 4192006 282.4 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/10_args-8 4219160 278.0 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/40_args-8 1283365 930.1 ns/op 1408 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/40_args-8 1301449 943.2 ns/op 1408 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/40_args-8 1261256 914.3 ns/op 1408 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/40_args-8 1298919 887.4 ns/op 1408 B/op 1 allocs/op
-BenchmarkAttrs/async_discard/40_args-8 1342897 889.1 ns/op 1408 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/5_args-8 6955764 176.7 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/fastText_discard/5_args-8 7571996 157.5 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/fastText_discard/5_args-8 6186126 178.4 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/fastText_discard/5_args-8 5276200 290.7 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/fastText_discard/5_args-8 6722038 197.9 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/fastText_discard/10_args-8 2247231 511.6 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/10_args-8 2304651 530.3 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/10_args-8 2294930 521.2 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/10_args-8 2327901 525.4 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/10_args-8 2202255 530.2 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/40_args-8 608607 1982 ns/op 1412 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/40_args-8 645728 1967 ns/op 1411 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/40_args-8 600284 1986 ns/op 1412 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/40_args-8 595011 2067 ns/op 1412 B/op 1 allocs/op
-BenchmarkAttrs/fastText_discard/40_args-8 554013 2037 ns/op 1412 B/op 1 allocs/op
-BenchmarkAttrs/Text_discard/5_args-8 1675130 728.9 ns/op 8 B/op 2 allocs/op
-BenchmarkAttrs/Text_discard/5_args-8 1702803 744.2 ns/op 8 B/op 2 allocs/op
-BenchmarkAttrs/Text_discard/5_args-8 1592347 754.2 ns/op 8 B/op 2 allocs/op
-BenchmarkAttrs/Text_discard/5_args-8 1658474 737.4 ns/op 8 B/op 2 allocs/op
-BenchmarkAttrs/Text_discard/5_args-8 1641886 742.2 ns/op 8 B/op 2 allocs/op
-BenchmarkAttrs/Text_discard/10_args-8 1000000 1286 ns/op 224 B/op 5 allocs/op
-BenchmarkAttrs/Text_discard/10_args-8 985032 1301 ns/op 224 B/op 5 allocs/op
-BenchmarkAttrs/Text_discard/10_args-8 1000000 1285 ns/op 224 B/op 5 allocs/op
-BenchmarkAttrs/Text_discard/10_args-8 937164 1285 ns/op 224 B/op 5 allocs/op
-BenchmarkAttrs/Text_discard/10_args-8 1000000 1256 ns/op 224 B/op 5 allocs/op
-BenchmarkAttrs/Text_discard/40_args-8 291607 4362 ns/op 1476 B/op 17 allocs/op
-BenchmarkAttrs/Text_discard/40_args-8 276548 4369 ns/op 1476 B/op 17 allocs/op
-BenchmarkAttrs/Text_discard/40_args-8 274687 4354 ns/op 1476 B/op 17 allocs/op
-BenchmarkAttrs/Text_discard/40_args-8 299493 4397 ns/op 1476 B/op 17 allocs/op
-BenchmarkAttrs/Text_discard/40_args-8 283070 4328 ns/op 1476 B/op 17 allocs/op
-BenchmarkAttrs/JSON_discard/5_args-8 1918728 645.7 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/JSON_discard/5_args-8 2024074 606.1 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/JSON_discard/5_args-8 1769748 657.8 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/JSON_discard/5_args-8 1868710 640.6 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/JSON_discard/5_args-8 1965302 627.2 ns/op 0 B/op 0 allocs/op
-BenchmarkAttrs/JSON_discard/10_args-8 1000000 1191 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/10_args-8 1000000 1190 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/10_args-8 1000000 1240 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/10_args-8 1000000 1195 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/10_args-8 1000000 1203 ns/op 208 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/40_args-8 349972 4133 ns/op 1411 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/40_args-8 298383 4087 ns/op 1411 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/40_args-8 324619 4116 ns/op 1411 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/40_args-8 302998 4223 ns/op 1411 B/op 1 allocs/op
-BenchmarkAttrs/JSON_discard/40_args-8 323319 4187 ns/op 1411 B/op 1 allocs/op
+BenchmarkAttrs/disabled/5_args-8 98288526 11.02 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args-8 100000000 10.97 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args-8 100000000 11.38 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args-8 100000000 11.00 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args-8 100000000 10.99 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args_ctx-8 100000000 10.98 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args_ctx-8 100000000 11.01 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args_ctx-8 94221319 11.01 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args_ctx-8 100000000 11.04 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/5_args_ctx-8 100000000 11.00 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/10_args-8 57471814 19.32 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/10_args-8 61708424 19.16 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/10_args-8 57874836 19.17 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/10_args-8 61938594 19.65 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/10_args-8 59963071 19.16 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/40_args-8 18328663 64.90 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/40_args-8 18434060 65.34 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/40_args-8 18177505 65.14 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/40_args-8 18379885 65.51 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/disabled/40_args-8 18349190 65.16 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args-8 14130172 85.01 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args-8 14645642 85.50 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args-8 13869007 84.77 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args-8 13934444 84.92 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args-8 14232910 84.39 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args_ctx-8 14116840 85.75 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args_ctx-8 13792731 84.49 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args_ctx-8 14136980 86.16 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args_ctx-8 12695575 85.25 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/5_args_ctx-8 14096670 85.01 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/async_discard/10_args-8 4446147 293.0 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/10_args-8 4037497 288.3 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/10_args-8 4345414 301.7 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/10_args-8 4287226 287.5 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/10_args-8 4355980 275.2 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/40_args-8 1302829 938.0 ns/op 1408 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/40_args-8 1310755 956.6 ns/op 1408 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/40_args-8 1292900 964.9 ns/op 1408 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/40_args-8 1257229 966.8 ns/op 1408 B/op 1 allocs/op
+BenchmarkAttrs/async_discard/40_args-8 1000000 1053 ns/op 1408 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/5_args-8 6900655 166.0 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args-8 6325740 162.1 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args-8 4901541 232.9 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args-8 7193606 170.2 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args-8 7622880 157.6 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args_ctx-8 5037357 272.8 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args_ctx-8 6330247 166.2 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args_ctx-8 7170688 181.0 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args_ctx-8 7848153 168.8 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/5_args_ctx-8 6864308 162.5 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/fastText_discard/10_args-8 2274127 513.1 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/10_args-8 2399744 509.5 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/10_args-8 2336054 519.0 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/10_args-8 2369473 519.8 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/10_args-8 2346710 512.1 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/40_args-8 643897 1977 ns/op 1412 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/40_args-8 537020 2000 ns/op 1412 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/40_args-8 647682 2021 ns/op 1412 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/40_args-8 538916 2101 ns/op 1412 B/op 1 allocs/op
+BenchmarkAttrs/fastText_discard/40_args-8 585639 2006 ns/op 1412 B/op 1 allocs/op
+BenchmarkAttrs/Text_discard/5_args-8 1630633 735.1 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args-8 1586420 758.0 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args-8 1547044 760.7 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args-8 1576621 737.8 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args-8 1556031 788.1 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args_ctx-8 1555112 778.1 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args_ctx-8 1531965 811.8 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args_ctx-8 1514307 791.6 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args_ctx-8 1596018 758.4 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/5_args_ctx-8 1615444 770.7 ns/op 8 B/op 2 allocs/op
+BenchmarkAttrs/Text_discard/10_args-8 972390 1375 ns/op 224 B/op 5 allocs/op
+BenchmarkAttrs/Text_discard/10_args-8 912907 1343 ns/op 224 B/op 5 allocs/op
+BenchmarkAttrs/Text_discard/10_args-8 978176 1349 ns/op 224 B/op 5 allocs/op
+BenchmarkAttrs/Text_discard/10_args-8 914865 1307 ns/op 224 B/op 5 allocs/op
+BenchmarkAttrs/Text_discard/10_args-8 1000000 1511 ns/op 224 B/op 5 allocs/op
+BenchmarkAttrs/Text_discard/40_args-8 240639 4929 ns/op 1477 B/op 17 allocs/op
+BenchmarkAttrs/Text_discard/40_args-8 279088 4647 ns/op 1476 B/op 17 allocs/op
+BenchmarkAttrs/Text_discard/40_args-8 266191 4596 ns/op 1477 B/op 17 allocs/op
+BenchmarkAttrs/Text_discard/40_args-8 256312 4727 ns/op 1477 B/op 17 allocs/op
+BenchmarkAttrs/Text_discard/40_args-8 281548 4638 ns/op 1476 B/op 17 allocs/op
+BenchmarkAttrs/JSON_discard/5_args-8 1768279 664.7 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args-8 1882438 669.6 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args-8 1936932 589.6 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args-8 1823818 612.8 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args-8 1839082 610.1 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args_ctx-8 1996665 606.6 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args_ctx-8 1916376 616.2 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args_ctx-8 2042916 592.5 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args_ctx-8 1744138 635.5 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/5_args_ctx-8 1841967 635.2 ns/op 0 B/op 0 allocs/op
+BenchmarkAttrs/JSON_discard/10_args-8 1000000 1126 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/10_args-8 1000000 1196 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/10_args-8 1000000 1129 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/10_args-8 1000000 1165 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/10_args-8 1000000 1156 ns/op 208 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/40_args-8 318490 4084 ns/op 1411 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/40_args-8 306403 4194 ns/op 1411 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/40_args-8 303225 4142 ns/op 1411 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/40_args-8 343528 4046 ns/op 1411 B/op 1 allocs/op
+BenchmarkAttrs/JSON_discard/40_args-8 311587 4043 ns/op 1411 B/op 1 allocs/op
PASS
-ok golang.org/x/exp/slog/benchmarks 109.134s
+ok golang.org/x/exp/slog/benchmarks 146.959s
diff --git a/slog/logger_test.go b/slog/logger_test.go
index f6a7599..3d0e5eb 100644
--- a/slog/logger_test.go
+++ b/slog/logger_test.go
@@ -361,14 +361,16 @@
// This is a simple benchmark. See the benchmarks subdirectory for more extensive ones.
func BenchmarkNopLog(b *testing.B) {
- b.ReportAllocs()
+ ctx := context.Background()
l := New(&captureHandler{})
b.Run("attrs", func(b *testing.B) {
+ b.ReportAllocs()
for i := 0; i < b.N; i++ {
l.LogAttrs(InfoLevel, "msg", Int("a", 1), String("b", "two"), Bool("c", true))
}
})
b.Run("attrs-parallel", func(b *testing.B) {
+ b.ReportAllocs()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
l.LogAttrs(InfoLevel, "msg", Int("a", 1), String("b", "two"), Bool("c", true))
@@ -376,8 +378,24 @@
})
})
b.Run("keys-values", func(b *testing.B) {
+ b.ReportAllocs()
for i := 0; i < b.N; i++ {
l.Log(InfoLevel, "msg", "a", 1, "b", "two", "c", true)
}
})
+ b.Run("WithContext", func(b *testing.B) {
+ b.ReportAllocs()
+ for i := 0; i < b.N; i++ {
+ l.WithContext(ctx).LogAttrs(InfoLevel, "msg", Int("a", 1), String("b", "two"), Bool("c", true))
+ }
+ })
+ b.Run("WithContext-parallel", func(b *testing.B) {
+ b.ReportAllocs()
+ b.RunParallel(func(pb *testing.PB) {
+ for pb.Next() {
+ l.WithContext(ctx).LogAttrs(InfoLevel, "msg", Int("a", 1), String("b", "two"), Bool("c", true))
+ }
+ })
+ })
+
}
diff --git a/slog/noplog.bench b/slog/noplog.bench
new file mode 100644
index 0000000..26d67ef
--- /dev/null
+++ b/slog/noplog.bench
@@ -0,0 +1,31 @@
+goos: linux
+goarch: amd64
+pkg: golang.org/x/exp/slog
+cpu: Intel(R) Xeon(R) CPU @ 2.20GHz
+BenchmarkNopLog/attrs-8 1000000 1120 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/attrs-8 1000000 1087 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/attrs-8 1000000 1125 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/attrs-8 1000000 1112 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/attrs-8 1000000 1116 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/attrs-parallel-8 3975526 297.7 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/attrs-parallel-8 4036947 308.5 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/attrs-parallel-8 4063410 297.1 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/attrs-parallel-8 4042863 293.7 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/attrs-parallel-8 4067066 295.9 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/keys-values-8 1000000 1051 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/keys-values-8 1000000 1050 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/keys-values-8 1000000 1044 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/keys-values-8 1000000 1057 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/keys-values-8 1000000 1064 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/WithContext-8 1000000 1103 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/WithContext-8 1000000 1103 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/WithContext-8 1000000 1112 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/WithContext-8 1000000 1081 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/WithContext-8 1000000 1112 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/WithContext-parallel-8 4040090 297.1 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/WithContext-parallel-8 4025874 297.8 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/WithContext-parallel-8 4039935 296.0 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/WithContext-parallel-8 4054540 299.9 ns/op 0 B/op 0 allocs/op
+BenchmarkNopLog/WithContext-parallel-8 4045884 295.9 ns/op 0 B/op 0 allocs/op
+PASS
+ok golang.org/x/exp/slog 31.654s