Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add benchmark-revision recipe #827

Merged
merged 11 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/.idea/
/.vagrant
/benchmark
/docs/build
/index.redb
/ord.log
Expand Down
17 changes: 17 additions & 0 deletions benchmark/checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

set -euxo pipefail

REV=$1

if [[ ! -d ord ]]; then
git clone https://github.com/casey/ord.git
fi

cd ord

git fetch --all --prune
git checkout master
git reset --hard origin/master
git checkout `git rev-parse origin/$REV`
./benchmark/run
13 changes: 13 additions & 0 deletions benchmark/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -euxo pipefail

systemctl stop ord-dev

rm -rf /var/lib/ord-dev

journalctl --unit ord-dev --rotate

journalctl --unit ord-dev --vacuum-time 1s

./bin/update-dev-server
2 changes: 2 additions & 0 deletions bin/update-dev-server
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ mkdir -p /etc/systemd/system/ord-dev.service.d

cp /etc/systemd/system/{ord,ord-dev}.service.d/override.conf

source ~/.cargo/env

cargo build --release

if [[ -f /usr/local/bin/ord-dev ]]; then
Expand Down
8 changes: 8 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ flamegraph dir=`git branch --show-current`:
benchmark index height-limit:
./bin/benchmark $1 $2

benchmark-revision rev:
ssh [email protected] "mkdir -p benchmark \
&& apt-get update --yes \
&& apt-get upgrade --yes \
&& apt-get install --yes git rsync"
rsync -avz benchmark/checkout [email protected]:benchmark/checkout
ssh [email protected] 'cd benchmark && ./checkout {{rev}}'

serve-docs:
mdbook serve docs --open

Expand Down