From 5152a5e2fa18db043556f97bb6fd2c55e89ce6d3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 16 Jun 2024 00:56:52 +1000 Subject: [PATCH] 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 --- .github/actions/just-setup/action.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 6d279257..c77901f9 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -123,3 +123,11 @@ 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 + + - 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"