element-hq / element-hq/dendrite
Move to zerolog
- Dominant language
- Go
- Stars
- 967
- Forks
- 102
- PR merge metrics
- No merged PRs in 30d
Description
*This issue was originally created by [**@kegsay**](https://github.com/kegsay) at .*
We should move to use https://github.com/uber-go/zap or https://github.com/rs/zerolog instead of logrus because logrus does a loooooot of allocations, far more than the rest of Dendrite. I'd propose we use the sugared one since we're not looking for any specific improvement other than "why is logging consuming so much time/allocs". In terms of numbers:
- logrus 29501 ns/op
- zap 1250 ns/op (~24x speedup)
Allocations:
- logrus 125 allocs/op
- zap 11 allocs/op
Contributor guide
Research direction
Start by locating Dendrite's logrus usage and comparing the proposed zerolog or zap APIs with the stated benchmark numbers. Define the migration boundary and verify logging behavior and performance across the affected paths; done means logging is consistently migrated and the allocation improvement is checked.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, observability-sre
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100