mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 15:05:19 +00:00
Download jetstream src from github instead of browserbench.org (#3196)
Downloading benchmark jetstream's source files one by one from https://browserbench.org by using wget is time consuming and not stable, this PR updates the scripts to download the files from https://github.com/mozilla/perf-automation.
This commit is contained in:
parent
cd63b3b8f2
commit
01575fc6da
|
@ -7,11 +7,11 @@ source /opt/emsdk/emsdk_env.sh
|
||||||
|
|
||||||
PLATFORM=$(uname -s | tr A-Z a-z)
|
PLATFORM=$(uname -s | tr A-Z a-z)
|
||||||
|
|
||||||
|
WORK_DIR=$PWD
|
||||||
OUT_DIR=$PWD/out
|
OUT_DIR=$PWD/out
|
||||||
WAMRC_CMD=$PWD/../../../wamr-compiler/build/wamrc
|
WAMRC_CMD=$PWD/../../../wamr-compiler/build/wamrc
|
||||||
|
JETSTREAM_DIR=$PWD/perf-automation/benchmarks/JetStream2/wasm
|
||||||
|
|
||||||
mkdir -p jetstream
|
|
||||||
mkdir -p tsf-src
|
|
||||||
mkdir -p ${OUT_DIR}
|
mkdir -p ${OUT_DIR}
|
||||||
|
|
||||||
if [[ $1 != "--no-simd" ]];then
|
if [[ $1 != "--no-simd" ]];then
|
||||||
|
@ -22,20 +22,16 @@ else
|
||||||
WASM_SIMD_FLAGS=""
|
WASM_SIMD_FLAGS=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd jetstream
|
if [ ! -d perf-automation ]; then
|
||||||
|
git clone https://github.com/mozilla/perf-automation.git
|
||||||
echo "Download source files .."
|
echo "Patch source files .."
|
||||||
wget -N https://browserbench.org/JetStream/wasm/gcc-loops.cpp
|
cd perf-automation
|
||||||
wget -N https://browserbench.org/JetStream/wasm/quicksort.c
|
patch -p1 -N < ../jetstream.patch
|
||||||
wget -N https://browserbench.org/JetStream/wasm/HashSet.cpp
|
|
||||||
wget -N https://browserbench.org/JetStream/simple/float-mm.c
|
|
||||||
|
|
||||||
if [[ $? != 0 ]]; then
|
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Patch source files .."
|
cd ${JETSTREAM_DIR}
|
||||||
patch -p1 -N < ../jetstream.patch
|
|
||||||
|
# Build gcc-loops
|
||||||
|
|
||||||
echo "Build gcc-loops with g++ .."
|
echo "Build gcc-loops with g++ .."
|
||||||
g++ -O3 ${NATIVE_SIMD_FLAGS} -o ${OUT_DIR}/gcc-loops_native gcc-loops.cpp
|
g++ -O3 ${NATIVE_SIMD_FLAGS} -o ${OUT_DIR}/gcc-loops_native gcc-loops.cpp
|
||||||
|
@ -56,6 +52,8 @@ if [[ ${PLATFORM} == "linux" ]]; then
|
||||||
${WAMRC_CMD} --enable-segue -o ${OUT_DIR}/gcc-loops_segue.aot ${OUT_DIR}/gcc-loops.wasm
|
${WAMRC_CMD} --enable-segue -o ${OUT_DIR}/gcc-loops_segue.aot ${OUT_DIR}/gcc-loops.wasm
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Build quicksort
|
||||||
|
|
||||||
echo "Build quicksort with gcc .."
|
echo "Build quicksort with gcc .."
|
||||||
gcc -O3 ${NATIVE_SIMD_FLAGS} -o ${OUT_DIR}/quicksort_native quicksort.c
|
gcc -O3 ${NATIVE_SIMD_FLAGS} -o ${OUT_DIR}/quicksort_native quicksort.c
|
||||||
|
|
||||||
|
@ -74,6 +72,8 @@ if [[ ${PLATFORM} == "linux" ]]; then
|
||||||
${WAMRC_CMD} --enable-segue -o ${OUT_DIR}/quicksort_segue.aot ${OUT_DIR}/quicksort.wasm
|
${WAMRC_CMD} --enable-segue -o ${OUT_DIR}/quicksort_segue.aot ${OUT_DIR}/quicksort.wasm
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Build HashSet
|
||||||
|
|
||||||
echo "Build HashSet with g++ .."
|
echo "Build HashSet with g++ .."
|
||||||
g++ -O3 ${NATIVE_SIMD_FLAGS} -o ${OUT_DIR}/HashSet_native HashSet.cpp \
|
g++ -O3 ${NATIVE_SIMD_FLAGS} -o ${OUT_DIR}/HashSet_native HashSet.cpp \
|
||||||
-lstdc++
|
-lstdc++
|
||||||
|
@ -93,6 +93,10 @@ if [[ ${PLATFORM} == "linux" ]]; then
|
||||||
${WAMRC_CMD} --enable-segue -o ${OUT_DIR}/HashSet_segue.aot ${OUT_DIR}/HashSet.wasm
|
${WAMRC_CMD} --enable-segue -o ${OUT_DIR}/HashSet_segue.aot ${OUT_DIR}/HashSet.wasm
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Build float-mm
|
||||||
|
|
||||||
|
cd ${JETSTREAM_DIR}/../simple
|
||||||
|
|
||||||
echo "Build float-mm with gcc .."
|
echo "Build float-mm with gcc .."
|
||||||
gcc -O3 ${NATIVE_SIMD_FLAGS} -o ${OUT_DIR}/float-mm_native float-mm.c
|
gcc -O3 ${NATIVE_SIMD_FLAGS} -o ${OUT_DIR}/float-mm_native float-mm.c
|
||||||
|
|
||||||
|
@ -111,7 +115,9 @@ if [[ ${PLATFORM} == "linux" ]]; then
|
||||||
${WAMRC_CMD} --enable-segue -o ${OUT_DIR}/float-mm_segue.aot ${OUT_DIR}/float-mm.wasm
|
${WAMRC_CMD} --enable-segue -o ${OUT_DIR}/float-mm_segue.aot ${OUT_DIR}/float-mm.wasm
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd ../tsf-src
|
# Build tsf
|
||||||
|
|
||||||
|
cd ${JETSTREAM_DIR}/TSF
|
||||||
|
|
||||||
tsf_srcs="tsf_asprintf.c tsf_buffer.c tsf_error.c tsf_reflect.c tsf_st.c \
|
tsf_srcs="tsf_asprintf.c tsf_buffer.c tsf_error.c tsf_reflect.c tsf_st.c \
|
||||||
tsf_type.c tsf_io.c tsf_native.c tsf_generator.c tsf_st_typetable.c \
|
tsf_type.c tsf_io.c tsf_native.c tsf_generator.c tsf_st_typetable.c \
|
||||||
|
@ -127,28 +133,6 @@ tsf_srcs="tsf_asprintf.c tsf_buffer.c tsf_error.c tsf_reflect.c tsf_st.c \
|
||||||
tsf_fsdb.c tsf_fsdb_protocol.c tsf_define_helpers.c tsf_ir.c \
|
tsf_fsdb.c tsf_fsdb_protocol.c tsf_define_helpers.c tsf_ir.c \
|
||||||
tsf_ir_different.c tsf_ir_speed.c"
|
tsf_ir_different.c tsf_ir_speed.c"
|
||||||
|
|
||||||
tsf_files="${tsf_srcs} config.h gpc_worklist.h \
|
|
||||||
tsf_config_stub.h tsf.h tsf_internal.h tsf_region.h tsf_types.h \
|
|
||||||
gpc.h tsf_atomics.h tsf_define_helpers.h tsf_indent.h tsf_inttypes.h \
|
|
||||||
tsf_serial_protocol.h tsf_util.h gpc_int_common.h tsf_build_defines.h \
|
|
||||||
tsf_format.h tsf_internal_config.h tsf_ir_different.h tsf_sha1.h \
|
|
||||||
tsf_zip_abstract.h gpc_internal.h tsf_config.h tsf_fsdb_protocol.h \
|
|
||||||
tsf_internal_config_stub.h tsf_ir.h tsf_st.h \
|
|
||||||
gpc_instruction_dispatch.gen gpc_instruction_stack_effects.gen \
|
|
||||||
gpc_instruction_to_string.gen gpc_instruction_size.gen \
|
|
||||||
gpc_instruction_static_size.gen gpc_interpreter.gen"
|
|
||||||
|
|
||||||
echo "Download tsf source files .."
|
|
||||||
for t in ${tsf_files}
|
|
||||||
do
|
|
||||||
wget -N "https://browserbench.org/JetStream/wasm/TSF/${t}"
|
|
||||||
if [[ $? != 0 ]]; then
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
patch -p1 -N < ../tsf.patch
|
|
||||||
|
|
||||||
echo "Build tsf with gcc .."
|
echo "Build tsf with gcc .."
|
||||||
gcc \
|
gcc \
|
||||||
-o ${OUT_DIR}/tsf_native -O3 ${NATIVE_SIMD_FLAGS} \
|
-o ${OUT_DIR}/tsf_native -O3 ${NATIVE_SIMD_FLAGS} \
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
diff -urN jetstream-org/HashSet.cpp jetstream/HashSet.cpp
|
diff --git a/benchmarks/JetStream2/wasm/HashSet.cpp b/benchmarks/JetStream2/wasm/HashSet.cpp
|
||||||
--- jetstream-org/HashSet.cpp 2020-10-30 04:12:42.000000000 +0800
|
index eca979b0..d1bf4d3d 100644
|
||||||
+++ jetstream/HashSet.cpp 2022-01-24 17:11:08.619831711 +0800
|
--- a/benchmarks/JetStream2/wasm/HashSet.cpp
|
||||||
|
+++ b/benchmarks/JetStream2/wasm/HashSet.cpp
|
||||||
@@ -22,8 +22,10 @@
|
@@ -22,8 +22,10 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -12,7 +13,7 @@ diff -urN jetstream-org/HashSet.cpp jetstream/HashSet.cpp
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
// Compile with: xcrun clang++ -o HashSet HashSet.cpp -O2 -W -framework Foundation -licucore -std=c++11 -fvisibility=hidden -DNDEBUG=1
|
// Compile with: xcrun clang++ -o HashSet HashSet.cpp -O2 -W -framework Foundation -licucore -std=c++11 -fvisibility=hidden -DNDEBUG=1
|
||||||
@@ -76,7 +78,7 @@
|
@@ -76,7 +78,7 @@ template<typename ToType, typename FromType>
|
||||||
inline ToType bitwise_cast(FromType from)
|
inline ToType bitwise_cast(FromType from)
|
||||||
{
|
{
|
||||||
typename std::remove_const<ToType>::type to { };
|
typename std::remove_const<ToType>::type to { };
|
||||||
|
@ -21,3 +22,42 @@ diff -urN jetstream-org/HashSet.cpp jetstream/HashSet.cpp
|
||||||
return to;
|
return to;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
diff --git a/benchmarks/JetStream2/wasm/TSF/gpc_code_gen_util.c b/benchmarks/JetStream2/wasm/TSF/gpc_code_gen_util.c
|
||||||
|
index 56220fa7..7e3a365b 100644
|
||||||
|
--- a/benchmarks/JetStream2/wasm/TSF/gpc_code_gen_util.c
|
||||||
|
+++ b/benchmarks/JetStream2/wasm/TSF/gpc_code_gen_util.c
|
||||||
|
@@ -34,6 +34,8 @@
|
||||||
|
#include <errno.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
|
||||||
|
+int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
|
||||||
|
+
|
||||||
|
/* code generation debugging */
|
||||||
|
|
||||||
|
/* NOTE: It is now the case that the count may be incremented multiple times,
|
||||||
|
diff --git a/benchmarks/JetStream2/wasm/TSF/tsf_internal.h b/benchmarks/JetStream2/wasm/TSF/tsf_internal.h
|
||||||
|
index 225a248b..ae39d3d3 100644
|
||||||
|
--- a/benchmarks/JetStream2/wasm/TSF/tsf_internal.h
|
||||||
|
+++ b/benchmarks/JetStream2/wasm/TSF/tsf_internal.h
|
||||||
|
@@ -429,6 +429,7 @@ struct tsf_fsdb {
|
||||||
|
#endif
|
||||||
|
tsf_fsdb_connection_t *connection;
|
||||||
|
#endif
|
||||||
|
+ uint32_t __padding;
|
||||||
|
} remote;
|
||||||
|
} u;
|
||||||
|
tsf_limits_t *limits;
|
||||||
|
diff --git a/benchmarks/JetStream2/wasm/TSF/tsf_ir_speed.c b/benchmarks/JetStream2/wasm/TSF/tsf_ir_speed.c
|
||||||
|
index dd75c43e..79435c42 100644
|
||||||
|
--- a/benchmarks/JetStream2/wasm/TSF/tsf_ir_speed.c
|
||||||
|
+++ b/benchmarks/JetStream2/wasm/TSF/tsf_ir_speed.c
|
||||||
|
@@ -63,6 +63,9 @@ static void writeTest(const char *filename,
|
||||||
|
Program_t *program;
|
||||||
|
unsigned elementIndex;
|
||||||
|
|
||||||
|
+ if (!(programIndex % 100))
|
||||||
|
+ printf("##programIndex: %u\n", programIndex);
|
||||||
|
+
|
||||||
|
CS(program = tsf_region_create(sizeof(Program_t)));
|
||||||
|
|
||||||
|
program->globals.len = numDecls + numDefns;
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
diff -urN tsf-src-org/gpc_code_gen_util.c tsf-src/gpc_code_gen_util.c
|
|
||||||
--- tsf-src-org/gpc_code_gen_util.c 2023-09-21 11:12:40.211166472 +0800
|
|
||||||
+++ tsf-src/gpc_code_gen_util.c 2023-09-21 11:09:13.643170967 +0800
|
|
||||||
@@ -34,6 +34,8 @@
|
|
||||||
#include <errno.h>
|
|
||||||
#include <dirent.h>
|
|
||||||
|
|
||||||
+int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
|
|
||||||
+
|
|
||||||
/* code generation debugging */
|
|
||||||
|
|
||||||
/* NOTE: It is now the case that the count may be incremented multiple times,
|
|
||||||
diff -urN tsf-src-org/tsf_internal.h tsf-src/tsf_internal.h
|
|
||||||
--- tsf-src-org/tsf_internal.h 2023-09-21 11:11:50.843167546 +0800
|
|
||||||
+++ tsf-src/tsf_internal.h 2023-09-21 11:06:53.031174027 +0800
|
|
||||||
@@ -429,6 +429,7 @@
|
|
||||||
#endif
|
|
||||||
tsf_fsdb_connection_t *connection;
|
|
||||||
#endif
|
|
||||||
+ uint32_t __padding;
|
|
||||||
} remote;
|
|
||||||
} u;
|
|
||||||
tsf_limits_t *limits;
|
|
||||||
diff -urN tsf-src-org/tsf_ir_speed.c tsf-src/tsf_ir_speed.c
|
|
||||||
--- tsf-src-org/tsf_ir_speed.c 2023-09-21 11:12:15.699167005 +0800
|
|
||||||
+++ tsf-src/tsf_ir_speed.c 2023-09-21 11:06:53.031174027 +0800
|
|
||||||
@@ -63,6 +63,9 @@
|
|
||||||
Program_t *program;
|
|
||||||
unsigned elementIndex;
|
|
||||||
|
|
||||||
+ if (!(programIndex % 100))
|
|
||||||
+ printf("##programIndex: %u\n", programIndex);
|
|
||||||
+
|
|
||||||
CS(program = tsf_region_create(sizeof(Program_t)));
|
|
||||||
|
|
||||||
program->globals.len = numDecls + numDefns;
|
|
Loading…
Reference in New Issue
Block a user