You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve perf with level guard in slogWrapper calls (#1374)
Previously, calls to methods such as (*slogWrapper).Debug and
(*slogWrapper).Debugf always resulted in calls to fmt.Sprint and
fmt.Sprintf respectively, regardless of whether the log level in
question was even enabled. Calls to fmt.Sprintf in particular can be
costly from a performance standpoint.
This change prevents such calls unless the log level in question is
currently enabled. Benchmarks on an Apple M3 Max result in a ~7x speed
improvement in 'f' method variants when the log level in question is
disabled.
0 commit comments