4

Change LLVM BOLT flags by Kobzol · Pull Request #114141 · rust-lang/rust · GitHu...

 10 months ago
source link: https://github.com/rust-lang/rust/pull/114141
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Change LLVM BOLT flags #114141

Conversation

Contributor

I talked to the BOLT maintainers about the binary size effect of BOLT. Currently, BOLTing LLVM increases its binary size from ~120 MiB to ~170 MiB, which is not ideal. Now we can track both runtime performance and (rustc, LLVM, ...) artifact sizes in perf.RLO, so I'd like to try experimenting with changing the flags to reduce libLLVM.so size without regressing the performance gains of BOLT too much.

r? @ghost

rustbot

added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

labels

Jul 27, 2023

Contributor

Author

This comment has been minimized.

rustbot

added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label

Jul 27, 2023

Contributor

⌛ Trying commit bc6b5fe with merge b734abf...

Contributor

sunny Try build successful - checks-actions
Build commit: b734abf (b734abfa73b23b4b0db768de4dba2901bca0ead5)

This comment has been minimized.

// Try to reuse old text segments to reduce binary size

.arg("--use-old-text")

.arg("--lite=0")

.arg("--no-huge-pages")

I assume the huge page alignment just adds padding, so it should compress fine and not affect download sizes and also shouldn't affect the amount of stuff that gets loaded into memory.

Contributor

Author

I'm not actually sure what this does, as it seems to be undocumented. I'll try without it.

Collaborator

Finished benchmarking commit (b734abf): comparison URL.

Overall result: xwhite_check_mark regressions and improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

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

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions x
(primary)
- - 0
Regressions x
(secondary)
0.7% [0.3%, 1.1%] 4
Improvements white_check_mark
(primary)
- - 0
Improvements white_check_mark
(secondary)
-0.3% [-0.3%, -0.3%] 1
All xwhite_check_mark (primary) - - 0

Max RSS (memory usage)

Results

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: 654.227s -> 655.834s (0.25%)

rustbot

removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label

Jul 28, 2023

Contributor

Author

Okay, pretty much no regressions and -50 MiB of LLVM size. Pretty nice. I'll try next what happens with just --use-old-text.

Contributor

Author

@bors try @rust-timer queue

Trying just --use-old-text.

This comment has been minimized.

rustbot

added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label

Jul 28, 2023

Contributor

hourglass Trying commit b996e5e with merge b5ad006...

Contributor

sunny Try build successful - checks-actions
Build commit: b5ad006 (b5ad0060faf5ff61111a1a191fe848f4955ac46f)

This comment has been minimized.

Collaborator

Finished benchmarking commit (b5ad006): comparison URL.

Overall result: white_check_mark improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

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

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions x
(primary)
- - 0
Regressions x
(secondary)
- - 0
Improvements white_check_mark
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
- - 0
All xwhite_check_mark (primary) -0.4% [-0.4%, -0.4%] 1

Max RSS (memory usage)

Results

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: 651.183s -> 650.167s (-0.16%)

lqd reacted with thumbs up emoji

rustbot

removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label

Jul 29, 2023

Kobzol

marked this pull request as ready for review

July 29, 2023 08:52

Contributor

Author

Ok, looks like adding this flag doesn't regress perf and saves 50 MiB of libLLVM size. That looks nice.

r? bootstrap

Member

@bors r+

Contributor

📌 Commit b996e5e has been approved by lqd

It is now in the queue for this repository.

bors

removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label

Jul 29, 2023

bors

added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label

Jul 29, 2023

Contributor

Author

BOLT can be tricky, so let's make sure that this is easier to revert if some issuea crop up.

@bors rollup=never

Contributor

hourglass Testing commit b996e5e with merge f45961b...

Contributor

☀️ Test successful - checks-actions
Approved by: lqd
Pushing f45961b to master...

bors

added the merged-by-bors This PR was explicitly merged by bors label

Jul 29, 2023

bors

merged commit f45961b into

rust-lang:master

Jul 29, 2023

12 checks passed

Kobzol

deleted the llvm-bolt-flags branch

July 29, 2023 11:29

Collaborator

Finished benchmarking commit (f45961b): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results

Cycles

Results

Binary size

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

Bootstrap: 652.022s -> 653.409s (0.21%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

the8472

the8472 left review comments
Labels
merged-by-bors This PR was explicitly merged by bors S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects

None yet

Milestone

1.73.0

Development

Successfully merging this pull request may close these issues.

None yet

7 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK