-
Notifications
You must be signed in to change notification settings - Fork 367
Closed
Description
Noticed this during a flamegraph analysis of our code
Looks like fmt.Sprintf is pretty expensive for CPU usage? Especially for Debug logging.
pulsar-client-go/pulsar/log/wrapper_slog.go
Lines 51 to 65 in a5c6dee
| func (s *slogWrapper) Debugf(format string, args ...any) { | |
| s.logger.Debug(fmt.Sprintf(format, args...)) | |
| } | |
| func (s *slogWrapper) Infof(format string, args ...any) { | |
| s.logger.Info(fmt.Sprintf(format, args...)) | |
| } | |
| func (s *slogWrapper) Warnf(format string, args ...any) { | |
| s.logger.Warn(fmt.Sprintf(format, args...)) | |
| } | |
| func (s *slogWrapper) Errorf(format string, args ...any) { | |
| s.logger.Error(fmt.Sprintf(format, args...)) | |
| } |
Metadata
Metadata
Assignees
Labels
No labels
