diff --git a/src/mono/wasm/Makefile b/src/mono/wasm/Makefile index 52e5de9e30227e..63e03b225468c7 100644 --- a/src/mono/wasm/Makefile +++ b/src/mono/wasm/Makefile @@ -72,7 +72,7 @@ MONO_LIBS = \ $(ICU_LIBDIR)/libicui18n.a EMCC_DEBUG_FLAGS =-g -Os -s -DDEBUG=1 -EMCC_RELEASE_FLAGS=-Oz +EMCC_RELEASE_FLAGS=-O2 ifeq ($(NOSTRIP),) STRIP_CMD=&& $(EMSDK_PATH)/upstream/bin/wasm-opt --strip-dwarf $(NATIVE_BIN_DIR)/dotnet.wasm -o $(NATIVE_BIN_DIR)/dotnet.wasm diff --git a/src/mono/wasm/build/WasmApp.Native.targets b/src/mono/wasm/build/WasmApp.Native.targets index e564d43520b592..22538f7ee777cf 100644 --- a/src/mono/wasm/build/WasmApp.Native.targets +++ b/src/mono/wasm/build/WasmApp.Native.targets @@ -161,6 +161,7 @@ <_EmccOptimizationFlagDefault Condition="'$(_EmccOptimizationFlagDefault)' == ''">-Oz $(_EmccOptimizationFlagDefault) + -O2 $(EmccCompileOptimizationFlag) <_EmccCompileRsp>$(_WasmIntermediateOutputPath)emcc-compile.rsp diff --git a/src/mono/wasm/wasm.proj b/src/mono/wasm/wasm.proj index 3eacc3e1307c13..1051ff672f95b1 100644 --- a/src/mono/wasm/wasm.proj +++ b/src/mono/wasm/wasm.proj @@ -180,7 +180,7 @@ -g -Os -s -DENABLE_NETCORE=1 -DDEBUG=1 - -Oz -DENABLE_NETCORE=1 + -O2 -DENABLE_NETCORE=1 "$(EMSDK_PATH)/upstream/bin/wasm-opt" --strip-dwarf "$(NativeBinDir)dotnet.wasm" -o "$(NativeBinDir)dotnet.wasm" $(ArtifactsObjDir)wasm $(WasmObjDir)\emcc-version.txt