WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 8473c4d

Browse files
authored
Merge pull request #292 from cfallin/jetstream-benchmarks
Add four benchmarks from JetStream 3: richards, quicksort, hashset, gcc-loops.
2 parents c18111e + 191b24f commit 8473c4d

19 files changed

+14745
-0
lines changed

benchmarks/all.suite

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,7 @@ shootout/shootout-xblabla20.wasm
118118
shootout/shootout-xchacha20.wasm
119119
spidermonkey/benchmark.wasm
120120
tract-onnx-image-classification/benchmark.wasm
121+
richards/benchmark.wasm
122+
gcc-loops/benchmark.wasm
123+
quicksort/benchmark.wasm
124+
hashset/benchmark.wasm

benchmarks/gcc-loops/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This two-phase Dockerfile allows us to avoid re-downloading APT packages and wasi-sdk with every
2+
# build.
3+
4+
# First, retrieve wasi-sdk:
5+
6+
FROM ubuntu:24.04 AS builder
7+
WORKDIR /
8+
RUN apt update && apt install -y wget
9+
10+
# Download and extract wasi-sdk.
11+
RUN wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-28/wasi-sdk-28.0-x86_64-linux.tar.gz
12+
RUN tar xvf wasi-sdk-28.0-x86_64-linux.tar.gz
13+
14+
# Second, compile the benchmark to Wasm.
15+
16+
FROM ubuntu:24.04
17+
WORKDIR /
18+
COPY --from=builder /wasi-sdk-28.0-x86_64-linux /wasi-sdk/
19+
20+
# Set common env vars.
21+
ENV CC=/wasi-sdk/bin/clang
22+
ENV CXX=/wasi-sdk/bin/clang++
23+
ENV LD=/wasi-sdk/bin/lld
24+
ENV CFLAGS=--sysroot=/wasi-sdk/share/wasi-sysroot
25+
ENV CXXFLAGS=--sysroot=/wasi-sdk/share/wasi-sysroot
26+
ENV PATH /wasi-sdk
27+
28+
# Compile `benchmark.c` to `./benchmark.wasm`.
29+
COPY gcc-loops.cpp .
30+
COPY sightglass.h .
31+
WORKDIR /benchmark
32+
RUN $CXX $CXXFLAGS ../gcc-loops.cpp -O3 -fno-exceptions -g -I.. -o benchmark.wasm
33+
# We output the Wasm file to the `/benchmark` directory, where the client
34+
# expects it.
2.7 MB
Binary file not shown.

benchmarks/gcc-loops/default.stderr.expected

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Results: (1e2fdc4e): ed7aa26a b9b28d5b 67808d19 b4412829 132bc4c6 132bc4c6 b4412829 eb3492a9 7e51915b 0 61ffda0c f95b0406 495fecb4 ab6b4a02 a1d16823 bdaa178a 0 67808d19

0 commit comments

Comments
 (0)