rust icon indicating copy to clipboard operation
rust copied to clipboard

Build `rustc` with 1CGU on `x86_64-apple-darwin`

Open lqd opened this issue 1 year ago • 29 comments

Distribute x86_64-apple-darwin artifacts built with rust.codegen-units=1, like we already do on Linux.

  1. effect on code size on x86_64-apple-darwin: it's a 11.14% reduction on librustc_driver.dylib
  1. time it took on CI:
  1. most recent perf results on (a noisy) x64 mac are here.

Related tracking issue for build configuration: #103595

lqd avatar Jun 04 '23 10:06 lqd

@bors try

lqd avatar Jun 04 '23 10:06 lqd

:hourglass: Trying commit 6ac543414ae34aa0ef4fb46d5978442bce42adc1 with merge 14c00943af8fc8297afbcf5d8a4d2cc0abb02e75...

bors avatar Jun 04 '23 10:06 bors

:sunny: Try build successful - checks-actions Build commit: 14c00943af8fc8297afbcf5d8a4d2cc0abb02e75 (14c00943af8fc8297afbcf5d8a4d2cc0abb02e75)

bors avatar Jun 04 '23 12:06 bors

:sunny: Try build successful - checks-actions Build commit: 14c00943af8fc8297afbcf5d8a4d2cc0abb02e75 (14c00943af8fc8297afbcf5d8a4d2cc0abb02e75)

bors avatar Jun 04 '23 12:06 bors

Locally on an aarch64-apple-darwin M1, using 1 CGU looks like this via rcb (w/ 2 baseline runs, to show the system noise):

benchmark baseline baseline noise baseline noise % 1CGU 1CGU %
clap:check 0.6678s 0.6683s +0.07% 0.6407s -4.06%
clap:check:initial 0.8064s 0.8047s -0.21% 0.7731s -4.13%
clap:check:unchanged 0.1737s 0.1737s -0.01% 0.1691s -2.67%
hyper:check 0.0980s 0.0973s -0.80% 0.0919s -6.23%
hyper:check:initial 0.1275s 0.1275s -0.05% 0.1226s -3.87%
hyper:check:unchanged 0.0531s 0.0529s -0.48% 0.0500s -5.87%
regex:check 0.3678s 0.3683s +0.14% 0.3529s -4.04%
regex:check:initial 0.4586s 0.4593s +0.16% 0.4405s -3.94%
regex:check:unchanged 0.1284s 0.1285s +0.10% 0.1246s -2.94%
syn:check 0.6108s 0.6106s -0.03% 0.5876s -3.79%
syn:check:initial 0.7596s 0.7590s -0.08% 0.7334s -3.46%
syn:check:unchanged 0.2347s 0.2330s -0.76% 0.2281s -2.83%
syntex_syntax:check 2.2357s 2.2401s +0.20% 2.1504s -3.82%
syntex_syntax:check:initial 2.7605s 2.7637s +0.12% 2.6673s -3.38%
syntex_syntax:check:unchanged 0.6608s 0.6631s +0.35% 0.6455s -2.32%
Total 10.1437s 10.1501s +0.06% 9.7778s -3.61%
Summary 5.0000s 4.9957s -0.09% 4.8088s -3.82%

lqd avatar Jun 04 '23 16:06 lqd

And on an old noisy x86_64-apple-darwin iMac, a few hyperfine runs on some of rcb's clean check benchmarks, with their dependencies. (I can't easily run it on try toolchains)

  • clap (noisy):
Benchmark 1: baseline try-parent 9eee230cd0a56bfba3ce65121798d9f9f4341cdd cargo check -j4
  Time (mean ± σ):     12.300 s ±  0.648 s    [User: 25.793 s, System: 3.245 s]
  Range (min … max):   11.850 s … 13.043 s    3 runs
 
Benchmark 2: try 14c00943af8fc8297afbcf5d8a4d2cc0abb02e75 cargo check -j4 with 1CGU rustc
  Time (mean ± σ):     11.230 s ±  0.052 s    [User: 25.170 s, System: 3.218 s]
  Range (min … max):   11.177 s … 11.281 s    3 runs
 
Summary
  'try 14c00943af8fc8297afbcf5d8a4d2cc0abb02e75 cargo check -j4 with 1CGU rustc' ran
    1.10 ± 0.06 times faster than 'baseline try-parent 9eee230cd0a56bfba3ce65121798d9f9f4341cdd cargo check -j4'
  • helloworld:
Benchmark 1: baseline try-parent 9eee230cd0a56bfba3ce65121798d9f9f4341cdd cargo check -j4
  Time (mean ± σ):     212.0 ms ±   0.5 ms    [User: 86.4 ms, System: 72.7 ms]
  Range (min … max):   211.5 ms … 212.4 ms    3 runs
 
Benchmark 2: try 14c00943af8fc8297afbcf5d8a4d2cc0abb02e75 cargo check -j4 with 1CGU rustc
  Time (mean ± σ):     201.2 ms ±   0.5 ms    [User: 82.0 ms, System: 68.0 ms]
  Range (min … max):   200.7 ms … 201.7 ms    3 runs
 
Summary
  'try 14c00943af8fc8297afbcf5d8a4d2cc0abb02e75 cargo check -j4 with 1CGU rustc' ran
    1.05 ± 0.00 times faster than 'baseline try-parent 9eee230cd0a56bfba3ce65121798d9f9f4341cdd cargo check -j4'
  • hyper:
Benchmark 1: baseline try-parent 9eee230cd0a56bfba3ce65121798d9f9f4341cdd cargo check -j4
  Time (mean ± σ):     12.111 s ±  0.390 s    [User: 27.421 s, System: 3.109 s]
  Range (min … max):   11.847 s … 12.560 s    3 runs
 
Benchmark 2: try 14c00943af8fc8297afbcf5d8a4d2cc0abb02e75 cargo check -j4 with 1CGU rustc
  Time (mean ± σ):     11.571 s ±  0.126 s    [User: 26.653 s, System: 3.086 s]
  Range (min … max):   11.427 s … 11.656 s    3 runs
 
Summary
  'try 14c00943af8fc8297afbcf5d8a4d2cc0abb02e75 cargo check -j4 with 1CGU rustc' ran
    1.05 ± 0.04 times faster than 'baseline try-parent 9eee230cd0a56bfba3ce65121798d9f9f4341cdd cargo check -j4'
  • regex:
Benchmark 1: baseline try-parent 9eee230cd0a56bfba3ce65121798d9f9f4341cdd cargo check -j4
  Time (mean ± σ):      3.369 s ±  0.067 s    [User: 4.040 s, System: 0.545 s]
  Range (min … max):    3.292 s …  3.413 s    3 runs
 
Benchmark 2: try 14c00943af8fc8297afbcf5d8a4d2cc0abb02e75 cargo check -j4 with 1CGU rustc
  Time (mean ± σ):      3.233 s ±  0.049 s    [User: 3.855 s, System: 0.534 s]
  Range (min … max):    3.199 s …  3.289 s    3 runs
 
Summary
  'try 14c00943af8fc8297afbcf5d8a4d2cc0abb02e75 cargo check -j4 with 1CGU rustc' ran
    1.04 ± 0.03 times faster than 'baseline try-parent 9eee230cd0a56bfba3ce65121798d9f9f4341cdd cargo check -j4'
  • syn:
Benchmark 1: baseline try-parent 9eee230cd0a56bfba3ce65121798d9f9f4341cdd cargo check -j4
  Time (mean ± σ):      2.776 s ±  0.026 s    [User: 2.752 s, System: 0.587 s]
  Range (min … max):    2.749 s …  2.802 s    3 runs
 
Benchmark 2: try 14c00943af8fc8297afbcf5d8a4d2cc0abb02e75 cargo check -j4 with 1CGU rustc
  Time (mean ± σ):      2.676 s ±  0.043 s    [User: 2.662 s, System: 0.583 s]
  Range (min … max):    2.646 s …  2.725 s    3 runs
 
Summary
  'try 14c00943af8fc8297afbcf5d8a4d2cc0abb02e75 cargo check -j4 with 1CGU rustc' ran
    1.04 ± 0.02 times faster than 'baseline try-parent 9eee230cd0a56bfba3ce65121798d9f9f4341cdd cargo check -j4'

lqd avatar Jun 04 '23 16:06 lqd

We were interested in the effect on code size on x86_64-apple-darwin: it's a 11% reduction on librustc_driver.dylib (it's unclear how much of that is on debuginfo, if any)

lqd avatar Jul 13 '23 10:07 lqd

@bors try

lqd avatar Sep 05 '23 08:09 lqd

:hourglass: Trying commit f4bdeec009d37f962f318af8c9d9cc2607a320f9 with merge 884d017364f6a089eaa586259bb66040ece4ec20...

bors avatar Sep 05 '23 08:09 bors

:sunny: Try build successful - checks-actions Build commit: 884d017364f6a089eaa586259bb66040ece4ec20 (884d017364f6a089eaa586259bb66040ece4ec20)

bors avatar Sep 05 '23 10:09 bors

1h52.

Let's try again, @bors try

lqd avatar Sep 05 '23 10:09 lqd

@bors try

lqd avatar Sep 05 '23 11:09 lqd

:hourglass: Trying commit f4bdeec009d37f962f318af8c9d9cc2607a320f9 with merge dcb21d731134b829241aaa8797e94c33efab2d3c...

bors avatar Sep 05 '23 11:09 bors

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

bors avatar Sep 05 '23 12:09 bors

1h29

lqd avatar Sep 05 '23 13:09 lqd

@bors try

lqd avatar Mar 05 '24 11:03 lqd

:hourglass: Trying commit 4296eae24fd0a04be5c06ebc0cc0de3ea52b8916 with merge 7549dbdc09f0c4f6cc84002ac03081828054784b...

bors avatar Mar 05 '24 11:03 bors

:sunny: Try build successful - checks-actions Build commit: 7549dbdc09f0c4f6cc84002ac03081828054784b (7549dbdc09f0c4f6cc84002ac03081828054784b)

bors avatar Mar 05 '24 13:03 bors

@bors try

lqd avatar Mar 05 '24 13:03 lqd

:hourglass: Trying commit 4296eae24fd0a04be5c06ebc0cc0de3ea52b8916 with merge 399d8a4eabbd579208ecef3e9f14f7973ebadecc...

bors avatar Mar 05 '24 13:03 bors

:sunny: Try build successful - checks-actions Build commit: 399d8a4eabbd579208ecef3e9f14f7973ebadecc (399d8a4eabbd579208ecef3e9f14f7973ebadecc)

bors avatar Mar 05 '24 15:03 bors

We were interested in

  1. the effect on code size on x86_64-apple-darwin: it's a 11.14% reduction on librustc_driver.dylib
  1. the time it took on CI:

lqd avatar Mar 05 '24 15:03 lqd

This may need some discussion within t-infra so I'll r? @Kobzol and let him ping others if needed, once he's happy after review.

lqd avatar Mar 05 '24 17:03 lqd

@bors r+ rollup=never

Kobzol avatar Mar 11 '24 22:03 Kobzol

:pushpin: Commit b36fa7091709ba075453a51c77aeec48fd5f259e has been approved by Kobzol

It is now in the queue for this repository.

bors avatar Mar 11 '24 22:03 bors

:hourglass: Testing commit b36fa7091709ba075453a51c77aeec48fd5f259e with merge 37ba5f42806eb560c82502a974b593cbd70ac746...

bors avatar Mar 11 '24 23:03 bors

The job aarch64-gnu failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] rustc_codegen_llvm test:false 66.982
   Compiling rustc_mir_transform v0.0.0 (/checkout/compiler/rustc_mir_transform)
[RUSTC-TIMING] rustc_traits test:false 17.413
   Compiling rustc_hir_typeck v0.0.0 (/checkout/compiler/rustc_hir_typeck)
##[error]The runner has received a shutdown signal. This can happen when the runner service is stopped, or a manually started runner is canceled.
##[group]Clock drift check
  local time: Tue Mar 12 00:01:55 UTC 2024
  network time: Tue, 12 Mar 2024 00:01:55 GMT
##[endgroup]
##[endgroup]
Session terminated, killing shell... ...killed.
##[error]The operation was canceled.

rust-log-analyzer avatar Mar 12 '24 00:03 rust-log-analyzer

:broken_heart: Test failed - checks-actions

bors avatar Mar 12 '24 00:03 bors

@bors retry The runner has received a shutdown signal

lqd avatar Mar 12 '24 00:03 lqd

:hourglass: Testing commit b36fa7091709ba075453a51c77aeec48fd5f259e with merge 5aad51d015b8d3f6d823a6bf9dbc8ae3b9fd10c5...

bors avatar Mar 12 '24 02:03 bors