Skip to content
Merged
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: 4 additions & 0 deletions benchmarks/all.suite
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,7 @@ shootout/shootout-xblabla20.wasm
shootout/shootout-xchacha20.wasm
spidermonkey/benchmark.wasm
tract-onnx-image-classification/benchmark.wasm
richards/benchmark.wasm
gcc-loops/benchmark.wasm
quicksort/benchmark.wasm
hashset/benchmark.wasm
34 changes: 34 additions & 0 deletions benchmarks/gcc-loops/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This two-phase Dockerfile allows us to avoid re-downloading APT packages and wasi-sdk with every
# build.

# First, retrieve wasi-sdk:

FROM ubuntu:24.04 AS builder
WORKDIR /
RUN apt update && apt install -y wget

# Download and extract wasi-sdk.
RUN wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-28/wasi-sdk-28.0-x86_64-linux.tar.gz
RUN tar xvf wasi-sdk-28.0-x86_64-linux.tar.gz

# Second, compile the benchmark to Wasm.

FROM ubuntu:24.04
WORKDIR /
COPY --from=builder /wasi-sdk-28.0-x86_64-linux /wasi-sdk/

# Set common env vars.
ENV CC=/wasi-sdk/bin/clang
ENV CXX=/wasi-sdk/bin/clang++
ENV LD=/wasi-sdk/bin/lld
ENV CFLAGS=--sysroot=/wasi-sdk/share/wasi-sysroot
ENV CXXFLAGS=--sysroot=/wasi-sdk/share/wasi-sysroot
ENV PATH /wasi-sdk

# Compile `benchmark.c` to `./benchmark.wasm`.
COPY gcc-loops.cpp .
COPY sightglass.h .
WORKDIR /benchmark
RUN $CXX $CXXFLAGS ../gcc-loops.cpp -O3 -fno-exceptions -g -I.. -o benchmark.wasm
# We output the Wasm file to the `/benchmark` directory, where the client
# expects it.
Binary file added benchmarks/gcc-loops/benchmark.wasm
Binary file not shown.
Empty file.
1 change: 1 addition & 0 deletions benchmarks/gcc-loops/default.stdout.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Results: (1e2fdc4e): ed7aa26a b9b28d5b 67808d19 b4412829 132bc4c6 132bc4c6 b4412829 eb3492a9 7e51915b 0 61ffda0c f95b0406 495fecb4 ab6b4a02 a1d16823 bdaa178a 0 67808d19
Loading