ethersphere / bee

Bee is a Swarm client implemented in Go. It’s the basic building block for the Swarm network: a private; decentralized; and self-sustaining network for permissionless publishing and access to your (application) data.
https://www.ethswarm.org
BSD 3-Clause "New" or "Revised" License
1.46k stars 337 forks source link

Optimize logger alocations #3211

Closed mrekucci closed 6 months ago

mrekucci commented 2 years ago

Write benchmark for logger and optimize memory allocations to a minimum. Consider a lock-free linked list as a data structure.

Resources: https://github.com/golang/glog/blob/master/glog.go#L488-L502 http://hackemist.com/logbench/ https://github.com/imkira/go-loggers-bench https://gist.github.com/Avinash-Bhat/48c4f06b0cc840d9fd6c https://github.com/uber-go/zap/tree/master/benchmarks

istae commented 1 year ago

have we seen any instances where the logging is a bottleneck?

mrekucci commented 1 year ago

have we seen any instances where the logging is a bottleneck?

Not really, it's just to avoid unnecessary memory allocations and put less strain on the GC.