wasmedge-quickjs icon indicating copy to clipboard operation
wasmedge-quickjs copied to clipboard

build with WASM SIMD128 instructions enabled by default

Open redfave opened this issue 2 years ago • 4 comments

Since SIMD is in wasmedge 0.9.0 enabled by default, it would be also sensible to build the QuickJS interpreter with SIMD instructions enabled by default.

redfave avatar Jan 18 '22 10:01 redfave

Just FYI. In order to enable SIMD support, the QuickJS C code (not just Rust wrapper) must also be compiled with SIMD. We are working on this feature and will have results soon. Thanks.

juntao avatar Jan 28 '22 08:01 juntao

flows summarize

juntao avatar Apr 05 '23 23:04 juntao

Hello, I am a serverless review bot on flows.network. Here are my reviews of code commits in this PR.


Commit 1

This patch creates a new file called .cargo/config.toml. In this patch, two lines are added to the config file:

  1. [build]: It creates a [build] section in the configuration file to specify the build options for the project.
  2. rustflags = "-C target-feature=+simd128": It enables the WASM SIMD128 instructions by default during the build process, setting the appropriate compiler flags through rustflags. This change allows the code to leverage the SIMD (Single Instruction, Multiple Data) parallel processing capability for performance improvements.

The potential problems that could arise from this change include:

  1. Compatibility issues: Enabling SIMD128 instructions could introduce compatibility issues. Not all environments support WASM SIMD128, and it may cause the code to malfunction or not run in some environments.
  2. No newline at the end of the file: This is a minor issue but may cause conflicts during in future merges. Adding a newline at the end of the file is a best practice to avoid conflicts when multiple developers work on the same file.

juntao avatar Apr 05 '23 23:04 juntao

How can I turn off SIMD? I'm trying to use wasmedge-quickjs outside of wasmedge and this is blocking our Wasm validation. I don't have easy control over the Wasmtime environment.

lastmjs avatar Jan 03 '24 00:01 lastmjs