Skip to content

Is there any advantage to preallocate memory with Builder::with_capacity? #7927

Closed Answered by surister
surister asked this question in Q&A
Discussion options

You must be logged in to vote

Actually, the number of values I was pushing to the array builders were always the allocated +1 due to another issue, I guess that triggers new allocation. With the right allocation number I get better numbers by using with_capacity as expected.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by surister
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant