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

Investigate slices.Grow performance #22

Closed
carsonip opened this issue Jul 13, 2023 · 1 comment
Closed

Investigate slices.Grow performance #22

carsonip opened this issue Jul 13, 2023 · 1 comment

Comments

@carsonip
Copy link
Member

In #18 we tried to replace the cap check with slices.Grow but the combined metrics encoding was >20% slower and a lot of memory was touched per op. See #18 (comment)

Investigate what is happening.

@simitt simitt assigned endorama and unassigned endorama Jul 24, 2023
@carsonip
Copy link
Member Author

I believe this is because I forgot to reslice, i.e. s = s[:0] before slices.Grow, and that slices.Grow(s, n) guarantees it will accommodate an additional n elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants