Poor use of memory / too many allocations in `HashLeaf`, leading to GC to work in overdrive
- Dominant language
- Go
- Stars
- 122
- Forks
- 53
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 5
Description
More time is spent in HashLeaf allocating, than hashing:

https://github.com/celestiaorg/nmt/blob/master/hasher.go#L190
https://flamegraph.com/share/a54e891a-1114-11ee-b13f-de9431916b05
---
Possibly related:
In celestia-node, min and max namespace take up 200MB (20%) of RAM

Contributor guide
Research direction
Start in hasher.go around line 190 and use the linked flamegraph to inspect why HashLeaf spends more time allocating than hashing. Profile the related namespace min/max memory behavior described in the issue, then verify that HashLeaf allocations and GC pressure are materially reduced.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cryptography, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100