From 43f05a712d0afa4f6e60d129b49c95df823731cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Cortier?= <3809077+CBenoit@users.noreply.github.com> Date: Thu, 13 Mar 2025 13:48:03 +0100 Subject: [PATCH] perf(web-client): enable WASM SIMD instructions (#703) --- web-client/iron-remote-gui/pre-build.js | 7 ++++++- xtask/src/web.rs | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/web-client/iron-remote-gui/pre-build.js b/web-client/iron-remote-gui/pre-build.js index 7ce00288..d2f3d396 100644 --- a/web-client/iron-remote-gui/pre-build.js +++ b/web-client/iron-remote-gui/pre-build.js @@ -2,7 +2,12 @@ import { spawn } from 'child_process'; let run = async function (command, cwd) { return new Promise((resolve) => { - const buildCommand = spawn(command, { stdio: 'pipe', shell: true, cwd: cwd }); + const buildCommand = spawn(command, { + stdio: 'pipe', + shell: true, + cwd: cwd, + env: { ...process.env, RUSTFLAGS: '-Ctarget-feature=+simd128' }, + }); buildCommand.stdout.on('data', (data) => { console.log(`${data}`); diff --git a/xtask/src/web.rs b/xtask/src/web.rs index 575bfc63..37191b3d 100644 --- a/xtask/src/web.rs +++ b/xtask/src/web.rs @@ -47,6 +47,7 @@ fn build(sh: &Shell, wasm_pack_dev: bool) -> anyhow::Result<()> { if wasm_pack_dev { run_cmd_in!(sh, IRONRDP_WEB_PATH, "wasm-pack build --dev --target web")?; } else { + let _env_guard = sh.push_env("RUSTFLAGS", "-Ctarget-feature=+simd128"); run_cmd_in!(sh, IRONRDP_WEB_PATH, "wasm-pack build --target web")?; }