Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pool temporary D objects #35

Open
cristaloleg opened this issue Dec 16, 2023 · 0 comments
Open

Pool temporary D objects #35

cristaloleg opened this issue Dec 16, 2023 · 0 comments
Labels
feature New feature or request

Comments

@cristaloleg
Copy link
Member

cristaloleg commented Dec 16, 2023

During encoding we've a few places where we allocate a new D for short period of time. Such allocations are harmless but we can get rid of them by allocating a D from sync.Pool.

As a result we should have zero-alloc encoding (in terms of D allocs, buffer grow or reflect is a separate topic).

Also: M.AsD() D should have an unexported version where we encode M into a given D.

@cristaloleg cristaloleg added the feature New feature or request label Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant