Commit 1b5cd2c4 authored by nagayama15's avatar nagayama15

Improve benchmark

parent 3a605f72
......@@ -13,3 +13,7 @@ indent_size = 2
[*.md]
trim_trailing_whitespace = false
[Makefile]
indent_style = tab
indent_size = 4
zlib-1-*.wasm
zlib-2-*.wasm
zlib-3-*.wasm
*.wast
SNPI := ../../build/src/snpi
AS := ../../build/binaryen/src/binaryen-build/bin/wasm-as
W1 := 60b725f1
W2 := 0c9c85c7
W3 := 0d97880d
W4 := fe8191b3
SRC := zlib-sample.wasm
TARGETS := \
zlib-1-${W1}.wasm \
zlib-2-${W1}.wasm \
zlib-3-${W1}.wasm \
zlib-1-${W2}.wasm \
zlib-2-${W2}.wasm \
zlib-3-${W2}.wasm \
zlib-1-${W3}.wasm \
zlib-2-${W3}.wasm \
zlib-3-${W3}.wasm \
zlib-1-${W4}.wasm \
zlib-2-${W4}.wasm \
zlib-3-${W4}.wasm
all: ${TARGETS}
node benchmark.js
zlib-1-%.wasm: zlib-sample.wasm
${SNPI} $< funcord ${@:zlib-1-%.wasm=%} > ${@:%.wasm=%.wast}
${AS} ${@:%.wasm=%.wast} -o $@
${RM} ${@:%.wasm=%.wast}
zlib-2-%.wasm: zlib-sample.wasm
${SNPI} $< opswap ${@:zlib-2-%.wasm=%} > ${@:%.wasm=%.wast}
${AS} ${@:%.wasm=%.wast} -o $@
${RM} ${@:%.wasm=%.wast}
zlib-3-%.wasm: zlib-1-%.wasm
${SNPI} $< opswap ${@:zlib-3-%.wasm=%} > ${@:%.wasm=%.wast}
${AS} ${@:%.wasm=%.wast} -o $@
${RM} ${@:%.wasm=%.wast}
clean:
${RM} zlib-1-*.wasm zlib-2-*.wasm zlib-3-*.wasm *.wast
......@@ -7,9 +7,18 @@ const rawData = Crypto.randomBytes(size);
(async function () {
const libPaths = [
`zlib-sample.wasm`,
`zlib-funcord.wasm`,
`zlib-opswap.wasm`,
`zlib-funcord-opswap.wasm`,
'zlib-1-0c9c85c7.wasm',
'zlib-1-0d97880d.wasm',
'zlib-1-60b725f1.wasm',
'zlib-1-fe8191b3.wasm',
'zlib-2-0c9c85c7.wasm',
'zlib-2-0d97880d.wasm',
'zlib-2-60b725f1.wasm',
'zlib-2-fe8191b3.wasm',
'zlib-3-0c9c85c7.wasm',
'zlib-3-0d97880d.wasm',
'zlib-3-60b725f1.wasm',
'zlib-3-fe8191b3.wasm',
];
const libs = await Promise.all(libPaths.map(async path => await require('./zlib').initialize(`${__dirname}/${path}`)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment