-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
I4No visible changesNo visible changesS3Minimally significantMinimally significantU4Nothing urgentNothing urgentenhancementImproving existing functionalityImproving existing functionalityperformanceMore of something per secondMore of something per second
Description
Is your feature request related to a problem? Please describe.
#3408 showed that https://pkg.go.dev/go.uber.org/zap#Logger.With is quite demanding in terms of resources. Being used frequently, it adds pretty visible alloc overhead. I propose to avoid using it as much as we can
moreover, when messages have lower severity level (e.g.debug in production), this is not just overhead but pure waste of resources
Describe the solution you'd like
never clone logger in request handlers and any other reoperations
even if cloning isn't done frequently in some cases, try to avoid it just to deduplicate common fields attached to different messages. Pass them explicitly or use var
Additional context
benchmarks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
I4No visible changesNo visible changesS3Minimally significantMinimally significantU4Nothing urgentNothing urgentenhancementImproving existing functionalityImproving existing functionalityperformanceMore of something per secondMore of something per second