Skip to content

Commit

Permalink
Add benchmark-revision recipe (ordinals#827)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Nov 22, 2022
1 parent 3916d4b commit c8f3336
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
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

0 comments on commit c8f3336

Please sign in to comment.