Skip to content

Conversation

IshankGulati
Copy link

Description

This feature enhances the unmarshalling performance for slices when the estimated capacity is known in advance. By preallocating the slice with the estimated capacity, it minimizes the need for reallocations and reduces the copying of elements in the underlying array.

Key Improvements

  • Optimized memory allocation for slices with predictable sizes.
  • Reduced overhead from unnecessary reallocations and element copying during unmarshalling.

This was requested in #286

Added struct tag to enable custom initial capacity for slices
@IshankGulati
Copy link
Author

IshankGulati commented Jan 15, 2025

@rvasily Can you review?

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

Successfully merging this pull request may close these issues.

1 participant