Speedup Linux CI (#1775)

* Speedup Linux CI

Use transparent huge page, according to https://kobzol.github.io/rust/rustc/2023/10/21/make-rust-compiler-5percent-faster.html it gives a nice 5% speedup

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

* Fix action.yml

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>

---------

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2024-06-16 01:08:25 +10:00 committed by GitHub
parent 0d7080e6a9
commit b9e8267cec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -123,3 +123,13 @@ runs:
- run: make -v
shell: bash
- name: Enable transparent huge page
if: runner.os == 'Linux'
run: echo madvise | sudo tee /sys/kernel/mm/transparent_hugepage/enabled
shell: bash
- name: Configure jemalloc (used by rustc) to use transparent huge page
if: runner.os == 'Linux'
run: echo "MALLOC_CONF=thp:always,metadata_thp:always" >> "$GITHUB_ENV"
shell: bash