mirror of
https://framagit.org/ppom/reaction
synced 2026-03-14 12:45:47 +01:00
Benchmark: Add real-life configuration file and benchmark wrapper
Performance on this real-life configuration: Before last commit: Service runtime: 2min 22.669s CPU time consumed: 3min 44.299s Memory peak: 50.7M (swap: 0B) With last commit: Service runtime: 7.569s CPU time consumed: 21.998s Memory peak: 105.6M (swap: 0B)
This commit is contained in:
parent
ad6b0faa30
commit
283d1867b8
4 changed files with 157 additions and 11 deletions
24
bench/bench.sh
Executable file
24
bench/bench.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
set -e
|
||||
|
||||
if test "$(realpath "$PWD")" != "$(realpath "$(dirname "$0")/..")"
|
||||
then
|
||||
echo "You must be in reaction root directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test ! -f "$1"
|
||||
then
|
||||
# shellcheck disable=SC2016
|
||||
echo '$1 must be a configuration file (most probably in ./bench)'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -f reaction.db
|
||||
cargo build --release
|
||||
sudo systemd-run --wait \
|
||||
-p User="$(id -nu)" \
|
||||
-p MemoryAccounting=yes \
|
||||
-p IOAccounting=yes \
|
||||
-p WorkingDirectory="$(pwd)" \
|
||||
-p Environment=PATH=/run/current-system/sw/bin/ \
|
||||
sh -c "for i in 1 2; do ./target/release/reaction start -c '$1' -l ERROR -s ./reaction.sock; done"
|
||||
Loading…
Add table
Add a link
Reference in a new issue