planetscale / planetscale/vtprotobuf
Pooled Objects - Recursive Pool Usage
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.1k
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Description
When unmarshalling an object from a pooled instance, the pooling support should be able to use pooled instances all the way down as it grabs and allocates objects. For example if:
message SomeMessage {
SecondMessage header = 1;
repeated OtherMessage items = 2;
}
Even if I pool the outer object, only that level is being serviced from the pool. As it expands the children, these are always new allocations today.
When unmarshalling into a pooled instance, I feel there should be a code path that obtains all instances down the tree (regardless of object depth) from the pools. An additional helper method that returns all instances to the pool would likewise be be valuable. This would enable complex structures to make use of pooling.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace the generated Go unmarshalling path for a pooled outer object, focusing on nested messages and repeated fields. Compare how child instances are obtained and define what complete recursive pooling and a helper that returns all descendants to the pools should look like.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100