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

bench: add bench action #173

Merged
merged 20 commits into from
Jul 12, 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
81 changes: 23 additions & 58 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Do not run this workflow on pull request since this workflow has permission to modify contents.
on:
workflow_dispatch:
inputs:
reason:
description: 'reason to trigger this build'
required: false

push:
branches:
- master

permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write

name: Bench

jobs:
Expand All @@ -26,55 +31,15 @@ jobs:
with:
toolchain: nightly
default: true
- uses: actions-rs/cargo@v1
name: Benchmark 🚀
with:
command: bench
args: --all-features --workspace
sanitizer_bench:
name: Bench with Sanitizer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Checkout 🛎️
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-sanitizer-bench
- uses: actions-rs/toolchain@v1
name: Setup Cargo Toolchain 🛎️
with:
components: rust-src
toolchain: nightly
default: true
- uses: actions-rs/cargo@v1
name: Bench with Address Sanitizer 🚀
with:
command: bench
args: --all-features -Zbuild-std --target x86_64-unknown-linux-gnu
env:
RUSTFLAGS: "-Zsanitizer=address"
- uses: actions-rs/cargo@v1
name: Bench with Leak Sanitizer 🚀
with:
command: bench
args: --all-features -Zbuild-std --target x86_64-unknown-linux-gnu
env:
RUSTFLAGS: "-Zsanitizer=leak"
- uses: actions-rs/cargo@v1
name: Bench with Memory Sanitizer 🚀
with:
command: bench
args: --all-features -Zbuild-std --target x86_64-unknown-linux-gnu
env:
RUSTFLAGS: "-Zsanitizer=memory"
- uses: actions-rs/cargo@v1
name: Bench with Thread Sanitizer 🚀
with:
command: bench
args: --all-features -Zbuild-std --target x86_64-unknown-linux-gnu
env:
RUSTFLAGS: "-Zsanitizer=thread"
- name: Benchmark 🚀
run: cargo +nightly bench --all-features --workspace --bench benches_agate_rocks -- --output-format bencher | tee output.txt
- uses: benchmark-action/github-action-benchmark@v1
name: Store benchmark result
with:
name: Benchmark with RocksDB
tool: "cargo"
output-file-path: output.txt
# Access token to deploy GitHub Pages branch
github-token: ${{ secrets.GITHUB_TOKEN }}
# Push and deploy GitHub pages branch automatically
auto-push: true
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ version = "0.1.0"
authors = ["Jay Lee <busyjaylee@gmail.com>"]
edition = "2018"

[features]
default = []
enable-rocksdb = ["rocksdb"]

[dependencies]
bytes = "1.0"
coarsetime = "0.1.22"
Expand All @@ -20,6 +24,7 @@ parking_lot = "0.11"
prost = "0.8"
proto = { path = "proto" }
rand = "0.7"
rocksdb = { version = "0.15", optional = true }
skiplist = { path = "skiplist" }
tempdir = "0.3"
thiserror = "1.0"
Expand Down Expand Up @@ -51,6 +56,10 @@ harness = false
name = "bench_iterator"
harness = false

[[bench]]
name = "benches_agate_rocks"
harness = false

[profile.bench]
opt-level = 3
debug = false
Expand Down
1 change: 1 addition & 0 deletions agate_bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ clap = "2.33"
indicatif = "0.15"
rand = "0.7"
rocksdb = { version = "0.15", optional = true }
tempdir = "0.3"
threadpool = "1.8"
yatp = { git = "https://github.com/tikv/yatp.git" }

Expand Down
Loading