diff mbox series

[V2] rust: Enable parallel-frontend-threads

Message ID 20260313060226.2354003-1-sundeep.kokkonda@windriver.com
State Under Review
Headers show
Series [V2] rust: Enable parallel-frontend-threads | expand

Commit Message

Sundeep KOKKONDA March 13, 2026, 6:02 a.m. UTC
From: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>

Enabled the parallel-frontend-threads for faster compilation of rust code.

Test Results:
A few tests (bitbake rust) ran by with and without enabling this option.
- Machine config: Intel(R) Xeon(R) CPU E5-4669 v3 @ 2.10GHz with 144 CPUs.
- Avg. default build time (w/o this option) - 56m 50.104s
- Avg. build time with this option - 49m 17.224s
- Performance Difference - 7m 32.880s faster builds (≈ 13.3%)

parallel-frontend-threads is limited to a max of 8 for best results.
More info - https://blog.rust-lang.org/2023/11/09/parallel-rustc/

Signed-off-by: Sundeep KOKKONDA <sundeep.kokkonda@windriver.com>
---
 meta/recipes-devtools/rust/rust_1.94.0.bb | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/rust/rust_1.94.0.bb b/meta/recipes-devtools/rust/rust_1.94.0.bb
index 2be0bd8d89..3ef80444bc 100644
--- a/meta/recipes-devtools/rust/rust_1.94.0.bb
+++ b/meta/recipes-devtools/rust/rust_1.94.0.bb
@@ -139,6 +139,7 @@  python do_configure() {
     config.set("rust", "llvm-tools", e(False))
     config.set("rust", "lld", e(False))
     config.set("rust", "use-lld", e(False))
+    config.set("rust", "parallel-frontend-threads", min(oe.utils.parallel_make(d),8))
     config.set("rust", "channel", e(d.expand("${RUST_CHANNEL}")))
 
     # Whether or not to optimize the compiler and standard library