Skip to content

Commit 1e3789a

Browse files
authored
Set codegen-units = 1 (#266)
Use [`codegen-units = 1`](https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units) for better runtime performance.
1 parent 921468c commit 1e3789a

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

.github/workflows/perfcheck.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,34 +55,34 @@ jobs:
5555
5656
- name: Build Yarn (base)
5757
working-directory: ../base
58-
run: cargo build --release -p zpm --bin yarn-bin
58+
run: cargo build --profile release-lto -p zpm --bin yarn-bin
5959

6060
- name: Build Yarn (head)
6161
working-directory: ../head
62-
run: cargo build --release -p zpm --bin yarn-bin
62+
run: cargo build --profile release-lto -p zpm --bin yarn-bin
6363

6464
- name: Start mock proxy
6565
working-directory: ../head
6666
run: |
67-
./target/release/yarn-bin debug mock-proxy -p 4873 https://registry.npmjs.org &
67+
./target/release-lto/yarn-bin debug mock-proxy -p 4873 https://registry.npmjs.org &
6868
echo "YARN_NPM_REGISTRY_SERVER=http://localhost:4873" >> $GITHUB_ENV
6969
echo "YARN_UNSAFE_HTTP_WHITELIST=localhost" >> $GITHUB_ENV
7070
7171
- name: Run benchmark cold (base)
7272
working-directory: ../base
73-
run: ./target/release/yarn-bin debug bench gatsby install-full-cold
73+
run: ./target/release-lto/yarn-bin debug bench gatsby install-full-cold
7474

7575
- name: Run benchmark cold (head)
7676
working-directory: ../head
77-
run: ./target/release/yarn-bin debug bench gatsby install-full-cold
77+
run: ./target/release-lto/yarn-bin debug bench gatsby install-full-cold
7878

7979
- name: Run benchmark warm with lockfile (base)
8080
working-directory: ../base
81-
run: ./target/release/yarn-bin debug bench gatsby install-cache-and-lock
81+
run: ./target/release-lto/yarn-bin debug bench gatsby install-cache-and-lock
8282

8383
- name: Run benchmark warm with lockfile (head)
8484
working-directory: ../head
85-
run: ./target/release/yarn-bin debug bench gatsby install-cache-and-lock
85+
run: ./target/release-lto/yarn-bin debug bench gatsby install-cache-and-lock
8686

8787
- name: Generate benchmark comment
8888
uses: actions/github-script@v7

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ debug = true
117117
[profile.release-lto]
118118
inherits = "release"
119119
lto = true
120+
codegen-units = 1
120121

121122
[profile.release-lto-nodebug]
122123
inherits = "release-lto"

0 commit comments

Comments
 (0)