Skip to content
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
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: CI

on: [push, pull_request]
on:
pull_request:
types: [ready_for_review]
push:
branches:
- main

jobs:
test:
Expand Down
77 changes: 0 additions & 77 deletions .github/workflows/pypi-publish.yml.disabled

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build Python Package

on:
pull_request:
types: [ready_for_review]
push:
branches:
- main

jobs:
build-wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Linux
- os: ubuntu-latest
target: x86_64
manylinux: auto
# - os: ubuntu-latest
# target: aarch64
# manylinux: auto
# # Windows
# - os: windows-latest
# target: x64
# manylinux: false
# - os: windows-latest
# target: x86
# manylinux: false
# # macOS
# - os: macos-latest
# target: x86_64
# manylinux: false
# - os: macos-14
# target: aarch64
# manylinux: false

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Build wheels (CPython only)
uses: PyO3/maturin-action@v1
env:
# Ensure PyO3 doesn't try to use PyPy
PYO3_CROSS_PYTHON_VERSION: "3.11"
with:
target: ${{ matrix.target }}
args: --release --out dist --features python --interpreter python3.11
sccache: 'true'
manylinux: ${{ matrix.manylinux }}
rust-toolchain: stable

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.target }}
path: dist
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,13 @@ required-features = ["git", "sql"]
[[bench]]
name = "prollytree_bench"
harness = false

[[bench]]
name = "sql_bench"
harness = false
required-features = ["sql"]

[[bench]]
name = "git_prolly_bench"
harness = false
required-features = ["git", "sql"]
111 changes: 111 additions & 0 deletions benches/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# ProllyTree Benchmarks

This directory contains comprehensive benchmarks for ProllyTree, including core operations, SQL functionality, and git-prolly integration.

## Available Benchmarks

### 1. Core ProllyTree Operations (`prollytree_bench.rs`)
Basic tree operations benchmarks:
- **Insert**: Single and batch insertions
- **Delete**: Single and batch deletions
- **Get**: Key lookups
- **Mixed operations**: Combined insert/get/delete operations

### 2. SQL Operations (`sql_bench.rs`)
GlueSQL integration benchmarks:
- **Insert**: SQL INSERT operations
- **Select**: Basic SELECT queries
- **Join**: JOIN operations between tables
- **Aggregation**: GROUP BY with aggregate functions
- **Update**: UPDATE operations
- **Delete**: DELETE operations
- **Index**: CREATE INDEX and indexed queries
- **Transaction**: Transaction performance
- **Complex queries**: Subqueries and complex SQL

### 3. Git-Prolly Integration (`git_prolly_bench.rs`)
Git versioning and SQL integration:
- **Versioned commits**: Multiple version commits
- **Git-SQL integration**: Combined git versioning with SQL queries
- **Git operations**: Basic git operations (commit, branch)
- **Branch operations**: Creating and switching branches
- **Time travel queries**: Historical data queries
- **Concurrent operations**: Parallel table operations

## Running Benchmarks

### Run all benchmarks:
```bash
cargo bench
```

### Run specific benchmark suite:
```bash
# Core benchmarks only
cargo bench --bench prollytree_bench

# SQL benchmarks only (requires sql feature)
cargo bench --bench sql_bench --features sql

# Git-Prolly benchmarks (requires both git and sql features)
cargo bench --bench git_prolly_bench --features git,sql
```

### Run specific benchmark within a suite:
```bash
# Run only insert benchmarks
cargo bench insert

# Run only SQL join benchmarks
cargo bench sql_join

# Run only git versioning benchmarks
cargo bench git_versioned
```

### Generate HTML reports:
```bash
# Results will be in target/criterion/report/index.html
cargo bench -- --verbose
```

### Compare with baseline:
```bash
# Save current results as baseline
cargo bench -- --save-baseline my_baseline

# Compare against baseline
cargo bench -- --baseline my_baseline
```

## Benchmark Configuration

Benchmarks use different data sizes to test scalability:
- Small: 100 records
- Medium: 500-1000 records
- Large: 10,000 records

Sample sizes and iterations are configured per benchmark group for optimal runtime.

## Interpreting Results

Results show:
- **Time**: Average time per operation
- **Throughput**: Operations per second
- **Variance**: Consistency of performance

Lower times and higher throughput indicate better performance.

## Adding New Benchmarks

1. Add benchmark function following the pattern:
```rust
fn bench_my_operation(c: &mut Criterion) {
let mut group = c.benchmark_group("my_operation");
// ... benchmark code
}
```

2. Add to appropriate criterion group at the bottom of the file

3. Update this README with the new benchmark description
Loading