katydid / katydid/parser-go

pool: create a more efficient pool implementation

Open
#20 0 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.