INSERT INTO ratio SELECT a.stack, a.file, a.cache, a.sc, (a.size - b.size) / CAST(a.size AS REAL) AS ratio
FROM bench AS a JOIN bench AS b USING (stack, file, cache, sc) WHERE a.algorithm = 't' AND b.algorithm = 's';
INSERT INTO ratio SELECT a.stack, a.file, a.sc, (a.size - b.size) / CAST(a.size AS REAL) AS ratio
FROM bench AS a JOIN bench AS b USING (stack, file, cache, sc) WHERE a.algorithm = 't' AND b.algorithm = 's' AND a.cache = 'Y';
.headers on
SELECT COUNT(CASE WHEN ratio < 0 THEN ratio END) as negative, COUNT(CASE WHEN ratio > 0 THEN ratio END) as positive, COUNT(CASE WHEN ratio = 0 THEN ratio END) as zero FROM ratio;
SELECT * FROM ratio WHERE ratio < 0;
SELECT stack, AVG(ratio) AS ratio FROM ratio GROUP BY stack;
SELECT stack, AVG(size) AS size FROM bench GROUP BY stack;
EOF
fi
# Remove temporary files
rm-f time-results.csv size-results.csv
}
if[[$# -lt 1 ]];then
echo"Usage: use at least one of the following commands."
echo-e"\t$0compile\n\t\tCompile the Java sources, to be run before [background_]run."
echo-e"\t$0run <STACK_SIZE>\n\t\tRun the benchmark with the given stack size."
echo-e"\t$0background_run <STACK_SIZE>\n\t\tLike run, but in the background."
echo-e"\t$0follow_logs <STACK_SIZE>\n\t\tFollow the execution of a given background task."
echo-e"\t$0define_erl_server\n\t\tCreates and launches a systemd service to host the Erlang server."
echo-e"\t$0destroy_erl_server\n\t\tStops the Erlang server."
echo-e"\t$0test_erl_server\n\t\tTest the connection between Java and Erlang (requires define_erl_server)."
echo-e"\t$0analyze_results\n\t\tProduce a table of average times with SQLite, based on previous runs."
echo"Usage: use exactly one of the following commands."
echo-e"\tcompile\n\t\tCompile the Java sources, to be run before [background_]run."
echo-e"\trun <STACK_SIZE>\n\t\tRun the benchmark with the given stack size."
echo-e"\tbackground_run <STACK_SIZE>\n\t\tLike run, but in the background."
echo-e"\tfollow_logs <STACK_SIZE>\n\t\tFollow the execution of a given background task."
echo-e"\tdefine_erl_server\n\t\tCreates and launches a systemd service to host the Erlang server."
echo-e"\tdestroy_erl_server\n\t\tStops the Erlang server."
echo-e"\ttest_erl_server\n\t\tTest the connection between Java and Erlang (requires define_erl_server)."
echo-e"\tanalyze_results [benchmark_result_folder(s)]\n\t\tProduce a table of average times with SQLite, based on all or selected runs."