perf: reduce llvm-lines by removing .extend([_; 2])#308
Merged
dtolnay merged 1 commit intodtolnay:masterfrom Nov 3, 2025
Merged
Conversation
dtolnay
approved these changes
Nov 3, 2025
Contributor
Author
|
Weird. On latest quote$ git log
commit 1253e2919ee22d51c94b61494c7e2de9e9392a3c (HEAD -> master, origin/master, origin/HEAD)
Merge: 6280f98 be59ab1
Author: David Tolnay <[email protected]>
Date: Mon Nov 3 13:05:13 2025 -0800
Merge pull request #308 from dishmaker/dishmaker/perf_llvml_runtime_append_arr
perf: reduce llvm-lines by removing `.extend([_; 2])`
quote$ cargo llvm-lines --release | head -n 3
Lines Copies Function name
----- ------ -------------
8658 365 (TOTAL)
quote$ cargo -V
cargo 1.93.0-nightly (636800288 2025-10-31) |
Owner
|
Related to // 8662 lines
do_append(self, token.into());
fn do_append(stream: &mut TokenStream, tree: TokenTree) {
stream.extend(Some(tree));
}// 8672 lines
do_append(self, token.into());
fn do_append(stream: &mut TokenStream, tree: TokenTree) {
stream.extend(iter::once(tree));
}// 7768 lines
self.extend(iter::once(token.into()));// 9376 lines
self.extend(Some(token.into())); |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before:
After: