Add memory runner for insert
This commit is contained in:
parent
884831ece5
commit
ce5f1c2f17
@ -8,22 +8,45 @@ CPUS=$(grep -c processor < /proc/cpuinfo)
|
|||||||
|
|
||||||
# Get all benchmark files
|
# Get all benchmark files
|
||||||
BENCHMARK_FILES=$(find ${WORKSPACE_DIR}/tests/benchmark -type f -iname "data_structures_*")
|
BENCHMARK_FILES=$(find ${WORKSPACE_DIR}/tests/benchmark -type f -iname "data_structures_*")
|
||||||
echo $(ls ${WORKSPACE_DIR}/tests/benchmark)
|
|
||||||
for BENCH_FILE in ${BENCHMARK_FILES}; do
|
function test_all() {
|
||||||
BASE_NAME=$(basename $BENCH_FILE)
|
for BENCH_FILE in ${BENCHMARK_FILES}; do
|
||||||
NAME=${BASE_NAME%%.*}
|
local BASE_NAME=$(basename $BENCH_FILE)
|
||||||
echo "Running $NAME"
|
local NAME=${BASE_NAME%%.*}
|
||||||
TEST_FILE=${WORKSPACE_DIR}/build/tests/benchmark/${NAME}
|
echo "Running $NAME"
|
||||||
if [[ -f "${TEST_FILE}" ]]; then
|
local TEST_FILE=${WORKSPACE_DIR}/build/tests/benchmark/${NAME}
|
||||||
pushd ${WORKSPACE_DIR}/build
|
if [[ -f "${TEST_FILE}" ]]; then
|
||||||
make -j${CPUS} memgraph__benchmark__${NAME}
|
pushd ${WORKSPACE_DIR}/build
|
||||||
popd
|
make -j${CPUS} memgraph__benchmark__${NAME}
|
||||||
JSON_OUTPUT=${NAME}_output.json
|
popd
|
||||||
# Run benchmakr test
|
local JSON_OUTPUT=${NAME}_output.json
|
||||||
${WORKSPACE_DIR}/build/tests/benchmark/${NAME} --benchmark_format=json --benchmark_out=${JSON_OUTPUT}
|
# Run benchmakr test
|
||||||
# Run analyze script for benchmark test
|
${WORKSPACE_DIR}/build/tests/benchmark/${NAME} --benchmark_format=json --benchmark_out=${JSON_OUTPUT}
|
||||||
python3 ${WORKSPACE_DIR}/tools/plot/benchmark_datastructures.py --log_file=${JSON_OUTPUT}
|
# Run analyze script for benchmark test
|
||||||
else
|
python3 ${WORKSPACE_DIR}/tools/plot/benchmark_datastructures.py --log_file=${JSON_OUTPUT}
|
||||||
echo "File ${TEST_FILE} does not exist!"
|
else
|
||||||
fi
|
echo "File ${TEST_FILE} does not exist!"
|
||||||
done
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_memory() {
|
||||||
|
## We are testing only insert
|
||||||
|
local DATA_STRUCTURES=(SkipList StdMap StdSet BppTree)
|
||||||
|
for DATA_STRUCTURE in ${DATA_STRUCTURES[@]}; do
|
||||||
|
valgrind --tool=massif --massif-out-file=${DATA_STRUCTURE}.massif.out ${WORKSPACE_DIR}/build/tests/benchmark/data_structures_insert --benchmark_filter=BM_BenchmarkInsert${DATA_STRUCTURE}/10000 --benchmark_format=json --benchmark_out=${DATA_STRUCTURE}.json
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
ARG_1=${1:-"all"}
|
||||||
|
case ${ARG_1} in
|
||||||
|
all)
|
||||||
|
test_all
|
||||||
|
;;
|
||||||
|
memory)
|
||||||
|
test_memory
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Select either `all` or `memory` benchmark!"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user