Skip to content

Reduce memory allocation by using .collect() #8

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

Merged
merged 3 commits into from
Jan 8, 2023
Merged

Reduce memory allocation by using .collect() #8

merged 3 commits into from
Jan 8, 2023

Conversation

hyf0
Copy link
Owner

@hyf0 hyf0 commented Jan 8, 2023

It turns out we could collect a PathBuf from Iterator<Item=Component>. This should give rust compiler a hint to do optimizations like pre-allocate memory. rust-lang/rust#41866.

Fix #7.

@hyf0 hyf0 changed the title Hyf 20230108 Reduce memory allocation by using .collect() Jan 8, 2023
@hyf0 hyf0 merged commit 7345d19 into main Jan 8, 2023
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.

perf: reduce allocation frequency in component_vec_to_path_buf
1 participant