Skip to content

Commit ef0e7e4

Browse files
mcollinaUzlopak
andauthored
Update lib/dispatcher/client-h1.js
Co-authored-by: Aras Abbasi <[email protected]>
1 parent b6438b1 commit ef0e7e4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/dispatcher/client-h1.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,17 @@ function lazyllhttp () {
6565

6666
let mod
6767

68-
// We are disabling wasm SIMD on ppc64 as it seems to be broken on Power 9 architectures.
69-
if (process.env.UNDICI_NO_WASM_SIMD !== '1' || process.arch !== 'ppc64') {
68+
// We disable wasm SIMD on ppc64 as it seems to be broken on Power 9 architectures.
69+
let useWasmSIMD = process.arch !== 'ppc64'
70+
71+
// The Env Variable UNDICI_NO_WASM_SIMD allows explicitly overriding the default behavior
72+
if (process.env.UNDICI_NO_WASM_SIMD === '1') {
73+
useWasmSIMD = true
74+
} else if (process.env.UNDICI_NO_WASM_SIMD === '0') {
75+
useWasmSIMD = false
76+
}
77+
78+
if (useSIMD) {
7079
try {
7180
mod = new WebAssembly.Module(require('../llhttp/llhttp_simd-wasm.js'))
7281
/* istanbul ignore next */

0 commit comments

Comments
 (0)