Skip to content

Conversation

Zalathar
Copy link
Contributor

This works because the only characters we care about escaping are ASCII characters, so forwarding non-ASCII UTF-8 bytes as-is still produces correct results.

r? ghost

@Zalathar Zalathar added the S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. label Sep 20, 2025
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 20, 2025
@Zalathar Zalathar removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 20, 2025
@Zalathar
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Sep 20, 2025
(EXPERIMENT) Perform target-machine command-line quoting as bytes, not characters
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 20, 2025
@rust-bors
Copy link

rust-bors bot commented Sep 20, 2025

☀️ Try build successful (CI)
Build commit: 515de9c (515de9cd3470057d08f216bc055bf2a2236db0c0, parent: ec38671075266e9cee0348701da2e133379e7c6c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (515de9c): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.7% [-8.2%, -0.3%] 8
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 470.599s -> 471.807s (0.26%)
Artifact size: 389.97 MiB -> 389.89 MiB (-0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 20, 2025
@Zalathar Zalathar changed the title (EXPERIMENT) Perform target-machine command-line quoting as bytes, not characters (EXPERIMENT) Perf experiments for target-machine command-line quoting Sep 20, 2025
@Zalathar
Copy link
Contributor Author

I'm going to recycle this PR for a few related perf experiments.

Ironically, benchmarking these changes is only possible because we prepare quoted command-line arguments for all targets, even though the string only gets used for generating PDBs.

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Sep 20, 2025
(EXPERIMENT) Perf experiments for target-machine command-line quoting
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 20, 2025
@Zalathar
Copy link
Contributor Author

There's a more general problem that producing this command-line string makes target_machine_factory relatively expensive, but there are a few callers that treat it as cheap.

It would be nice to build the string at most once per rustc, but we'd have to figure out where to put the necessary mutable state.

@rust-bors
Copy link

rust-bors bot commented Sep 20, 2025

☀️ Try build successful (CI)
Build commit: 09a6b1d (09a6b1dbdadd53e80e5fc085caefd7d23daf7793, parent: e4b521903b3b1a671e26a70b9475bcff385767e5)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (09a6b1d): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.3%, -0.2%] 3
Improvements ✅
(secondary)
-1.5% [-9.2%, -0.3%] 11
All ❌✅ (primary) -0.3% [-0.3%, -0.2%] 3

Max RSS (memory usage)

Results (primary 0.9%, secondary 3.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.8% [0.8%, 2.4%] 3
Regressions ❌
(secondary)
3.4% [3.4%, 3.4%] 1
Improvements ✅
(primary)
-1.7% [-1.7%, -1.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.9% [-1.7%, 2.4%] 4

Cycles

Results (secondary -2.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 472.018s -> 473.009s (0.21%)
Artifact size: 389.98 MiB -> 389.96 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 20, 2025
… all?

This demonstrates the theoretical limits of optimizing the quoting process.
@rustbot
Copy link
Collaborator

rustbot commented Sep 22, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Zalathar
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Sep 22, 2025
(EXPERIMENT) Perf experiments for target-machine command-line quoting
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 22, 2025
@rust-bors
Copy link

rust-bors bot commented Sep 22, 2025

☀️ Try build successful (CI)
Build commit: 3cad4c1 (3cad4c1f7f06414cb89aa67750ddd77153f59100, parent: 9f32ccf35fb877270bc44a86a126440f04d676d0)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3cad4c1): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 2
Improvements ✅
(primary)
-0.4% [-0.5%, -0.3%] 5
Improvements ✅
(secondary)
-1.5% [-18.4%, -0.0%] 22
All ❌✅ (primary) -0.4% [-0.5%, -0.3%] 5

Max RSS (memory usage)

Results (primary 0.9%, secondary 2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.5% [2.4%, 2.5%] 2
Regressions ❌
(secondary)
4.5% [2.3%, 5.1%] 8
Improvements ✅
(primary)
-0.6% [-0.8%, -0.5%] 2
Improvements ✅
(secondary)
-1.9% [-2.3%, -1.0%] 4
All ❌✅ (primary) 0.9% [-0.8%, 2.5%] 4

Cycles

Results (primary 2.0%, secondary -1.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.0% [2.0%, 2.0%] 1
Regressions ❌
(secondary)
2.4% [2.2%, 2.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.6% [-5.5%, -2.2%] 5
All ❌✅ (primary) 2.0% [2.0%, 2.0%] 1

Binary size

Results (secondary 0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Bootstrap: 471.273s -> 471.264s (-0.00%)
Artifact size: 387.92 MiB -> 389.96 MiB (0.53%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 22, 2025
@bors
Copy link
Collaborator

bors commented Sep 22, 2025

☔ The latest upstream changes (presumably #146879) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 22, 2025
@Zalathar Zalathar closed this Sep 24, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 24, 2025
@Zalathar Zalathar deleted the quoted-args branch September 24, 2025 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants