pool: create a more efficient pool implementation
- Dominant language
- Go
- Stars
- 0
- Forks
- 0
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
The current pool package only has a very basic implementation of pool:
```go
type Pool interface {
FreeAll()
Alloc(size int) []byte
Size() int
}
```
We want to minimise the amount of actual allocations, by saving the buffers we have already allocated to reuse them for future allocations required by parsers.
Use cases include:
* converting float64 to bytes
* converting int64 to bytes
* unquoting a string
Note: We do not want any concurrency, so we do not want to use sync.Pool.
See pool/basic.go for an example implementation that we a more efficient version of.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the pool interface and the example implementation in pool/basic.go. Trace the listed parser use cases—float64 and int64 conversion and string unquoting—to understand the allocation patterns the pool must support. Done means providing a more efficient reusable pool implementation that minimizes allocations without introducing concurrency or sync.Pool.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100