Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion benchmarks/all.suite
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ shootout/shootout-sieve.wasm
shootout/shootout-switch.wasm
shootout/shootout-xblabla20.wasm
shootout/shootout-xchacha20.wasm
spidermonkey/benchmark.wasm
spidermonkey/spidermonkey-markdown.wasm
spidermonkey/spidermonkey-json.wasm
spidermonkey/spidermonkey-regex.wasm
tract-onnx-image-classification/benchmark.wasm
richards/benchmark.wasm
gcc-loops/benchmark.wasm
Expand Down
9 changes: 9 additions & 0 deletions benchmarks/spidermonkey.suite
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SpiderMonkey benchmarks - JavaScript benchmarks running on SpiderMonkey compiled to WebAssembly.
#
# These benchmarks use Mozilla's SpiderMonkey JavaScript engine embedded in
# WebAssembly to execute JavaScript workloads, testing both the JS engine
# performance and WASM execution characteristics.

spidermonkey/spidermonkey-json.wasm
spidermonkey/spidermonkey-markdown.wasm
spidermonkey/spidermonkey-regex.wasm
33 changes: 22 additions & 11 deletions benchmarks/spidermonkey/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
FROM ubuntu:20.04
FROM ubuntu:24.04

# WASI SDK version to use - update this to upgrade
ARG WASI_SDK_VERSION=29

RUN apt-get update
RUN apt-get -y install git curl wget xxd
ENV PATH=/root/.cargo/bin:$PATH

# Build SpiderMonkey itself.
WORKDIR /usr/src
RUN git clone -b rev_b02d76023a15a3fa8c8f54bff5dac91099669003 --single-branch https://github.com/tschneidereit/spidermonkey-wasi-embedding
RUN git clone -b rev_b02d76023a15a3fa8c8f54bff5dac91099669003 \
--single-branch https://github.com/bytecodealliance/spidermonkey-wasi-embedding
WORKDIR /usr/src/spidermonkey-wasi-embedding
ENV DEBIAN_FRONTEND=noninteractive
RUN ./download-engine.sh

WORKDIR /opt
RUN wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.tar.gz
RUN tar zxvf wasi-sdk-25.0-x86_64-linux.tar.gz
RUN ln -s wasi-sdk-25.0-x86_64-linux wasi-sdk
# Download the appropriate wasi-sdk for the target architecture
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "x86_64" ]; then \
WASI_ARCH="x86_64"; \
elif [ "$ARCH" = "aarch64" ]; then \
WASI_ARCH="arm64"; \
else \
echo "Unsupported architecture: $ARCH" && exit 1; \
fi && \
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_VERSION}.0-${WASI_ARCH}-linux.tar.gz && \
tar zxvf wasi-sdk-${WASI_SDK_VERSION}.0-${WASI_ARCH}-linux.tar.gz && \
ln -s wasi-sdk-${WASI_SDK_VERSION}.0-${WASI_ARCH}-linux wasi-sdk

WORKDIR /usr/src

RUN mkdir benchmark && cd benchmark/

# Copy runtime, sightglass header, JS files, and build script
COPY runtime.cpp .
COPY sightglass.h .
COPY js js
COPY build.sh .

RUN mkdir js
COPY js/marked.min.js js/marked.min.js
COPY js/main.js js/main.js
RUN chmod +x build.sh

RUN ./build.sh
# We output the Wasm files to the `/benchmark` directory, where the client expects it.
Loading