Skip to content

Commit

Permalink
Update CI benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiemh committed Sep 19, 2024
1 parent 643a425 commit 3210b91
Showing 1 changed file with 83 additions and 23 deletions.
106 changes: 83 additions & 23 deletions .github/workflows/crud-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,108 @@ defaults:
jobs:

format:
name: Crud-bench
name: Check format
runs-on: ubuntu-latest
steps:

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Checkout sources
uses: actions/checkout@v4

- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Check format
run: cargo fmt --all --check

- name: Run clippy
run: cargo clippy --tests -- -D warnings
clippy:
name: Check clippy
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Checkout sources
uses: actions/checkout@v4

- name: Test
run: cargo test
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Build
run: cargo build
- name: Check clippy
run: cargo clippy --tests -- -D warnings

- name: Bench Dry
run: cargo run -- -d dry -s 10000 -t 3
test:
name: Check tests
runs-on: ubuntu-latest
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Checkout sources
uses: actions/checkout@v4

- name: Bench Redis
run: cargo run -- -d redis -s 10000 -t 3
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Bench Postgres
run: cargo run -- -d postgres -s 10000 -t 3
- name: Check tests
run: cargo test

- name: Bench MongoDB
run: cargo run -- -d mongodb -s 10000 -t 3
benchmark:
name: Benchmark ${{ matrix.description }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Dry
- database: dry
description: Dry
# Redis
- database: redis
description: Redis
# Postgres
- database: postgres
description: Postgres
# MongoDB
- database: mondoDB
description: MongoDB
# SurrealDB + Memory
- database: surrealdb-memory
description: SurrealDB with in-memory storage
# SurrealDB + RocksDB
- database: surrealdb-rocksdb
description: SurrealDB with RocksDB storage
# SurrealDB + SurrealKV
- database: surrealdb-surrealkv
description: SurrealDB with SurrealKV storage
steps:
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Checkout sources
uses: actions/checkout@v4

- name: Bench SurrealDB+Memory
run: cargo run -- -d surrealdb-memory -s 10000 -t 3
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}

- name: Bench SurrealDB+RocksDB
run: cargo run -- -d surrealdb-rocksdb -s 10000 -t 3
- name: Run benchmarks (10,000 samples / 3 threads)
run: cargo run -r -- -d ${{ matrix.database }} -s 10000 -t 3

- name: Bench SurrealDB+SurrealKV
run: cargo run -- -d surrealdb-surrealkv -s 10000 -t 3
- name: Run benchmarks (30,000 samples / 32 threads)
run: cargo run -r -- -d ${{ matrix.database }} -s 30000 -t 32

- name: Run benchmarks (100,000 samples / 32 threads)
run: cargo run -r -- -d ${{ matrix.database }} -s 100000 -t 32

0 comments on commit 3210b91

Please sign in to comment.