hashicorp / hashicorp/go-version
Memory increasing every Version.String() called
- Dominant language
- Go
- Stars
- 1.8k
- Forks
- 165
- Avg merge
- 23h 42m
- Merged PRs (30d)
- 2
Description
Version.String() currently returns every new string from buffer.
Also, Version.Compare calles Version.String() internally.
When I should compare many Versions, every Compare func creates new string.
It requires too many memories, and cases too heavy GC.
I propose result of Version.String() should be cached internally (like original).
How do you think about?
Contributor guide
Research direction
Start at the Version.String() and Version.Compare() entry points described in the issue, then inspect how repeated comparisons create strings. Verify the behavior with repeated Version comparisons and confirm that the resulting memory allocations and garbage-collection pressure are reduced while String() and Compare() retain their existing results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100