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

fix: remove unnecessary allocations #8641

Merged
merged 2 commits into from
Aug 23, 2020
Merged

Conversation

weihanglo
Copy link
Member

Remove unnecessary str::to_string and str::replace allocations by using iterators. This PR is almost identical to #8622 except it does not skip the generated header.

Sorry that I did not profile the changes by myself. Seems that valgrind does not support macOS 10.15.6, I have not idea how to profile cargo subcommand. It would be great for an instruction to run a memory profiling for Rust program on macOS.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 23, 2020
@Eh2406
Copy link
Contributor

Eh2406 commented Aug 23, 2020

wuld Iterator.eq work here?

@weihanglo
Copy link
Member Author

wuld Iterator.eq work here?

Updated. Thanks 😄

@Eh2406
Copy link
Contributor

Eh2406 commented Aug 23, 2020

@bors r+
Thank you for the contribution!

@bors
Copy link
Collaborator

bors commented Aug 23, 2020

📌 Commit 0c70319 has been approved by Eh2406

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 23, 2020
@bors
Copy link
Collaborator

bors commented Aug 23, 2020

⌛ Testing commit 0c70319 with merge 5165270...

@bors
Copy link
Collaborator

bors commented Aug 23, 2020

☀️ Test successful - checks-actions
Approved by: Eh2406
Pushing 5165270 to master...

@bors bors merged commit 5165270 into rust-lang:master Aug 23, 2020
@weihanglo weihanglo deleted the fix/remove-alloc branch August 23, 2020 13:45
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 31, 2020
Update cargo

8 commits in 51b66125ba97d2906f461b3f4e0408f206299bb6..126907a7cfccbe93778530e6a6bbaa3adb6c515c
2020-08-19 20:22:52 +0000 to 2020-08-31 20:42:11 +0000
- Fix flakiness in close_output test (rust-lang/cargo#8668)
- Reload unstable table from config file in `reload_rooted_at` (rust-lang/cargo#8656)
- Bump to 0.49.0, update changelog (rust-lang/cargo#8659)
- Fix LTO with doctests. (rust-lang/cargo#8657)
- Add spaces after -C and -Z flags for consistency (rust-lang/cargo#8648)
- Fix cache_messages::rustdoc test broken on beta. (rust-lang/cargo#8653)
- fix: remove unnecessary allocations (rust-lang/cargo#8641)
- Fixed a spelling and some clippy warnings (rust-lang/cargo#8637)
@ehuss ehuss added this to the 1.48.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants