golang/src/log
Kevin Burke 13a1f39ade log/slog: use plain string concatenation for Attr.String
Plain string concatenation with the plus operator for Attr.String is
much faster than invoking fmt.Sprintf. Added a benchmark to verify
this (just running on my Mac with stuff in the background but should
be sufficient to demonstrate the effect).

name          old time/op  new time/op  delta
AttrString-8  1.24µs ± 3%  0.43µs ± 0%  -65.17%  (p=0.000 n=20+17)

name          old alloc/op   new alloc/op   delta
AttrString-8      432B ± 0%      152B ± 0%   ~     (p=1.000 n=1+1)

name          old allocs/op  new allocs/op  delta
AttrString-8      30.0 ± 0%      16.0 ± 0%   ~     (p=1.000 n=1+1)

Change-Id: I18ac91cbff1047d168b51a595601e36b5f676615
Reviewed-on: https://go-review.googlesource.com/c/go/+/573517
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2024-03-25 18:23:25 +00:00
..
internal log,log/slog: get correct source line when slog calls log 2023-04-12 18:33:50 +00:00
slog log/slog: use plain string concatenation for Attr.String 2024-03-25 18:23:25 +00:00
syslog log: add available godoc link 2023-10-23 22:56:07 +00:00
example_test.go log: adds a Logger Output method Example 2017-07-16 03:57:11 +00:00
log.go log: add available godoc link 2023-10-23 22:56:07 +00:00
log_test.go log: avoid leaking goroutines in TestOutputRace 2023-04-21 20:04:37 +00:00