Skip to content

Commit 179633b

Browse files
authored
perf: optimize V8 engine by eliminating redundant instantiation (#70)
* Adds benchmarks * Updates docs
1 parent 18cb207 commit 179633b

File tree

11 files changed

+802
-32
lines changed

11 files changed

+802
-32
lines changed

.claude/commands/pr-submit.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Create a PR for the existing branch.
2+
3+
Keep the PR title and body concise. Use the following title prefixes:
4+
5+
- `fix:` for production code bug fixes
6+
- `perf:` for production code performance improvements
7+
- `feat:` for new features
8+
- `docs:` for documentation improvements (including README.md and CLAUDE.md)
9+
- `ci:` for CI improvements
10+
11+
based on what best describes the changes.
12+
13+
Avoid extraneous emphasis and emojis in the PR body. It should be factual and neutral.
14+
15+
Consider at least:
16+
17+
- Background (if any)
18+
- If fixing bugs, reproduction steps
19+
- Changes to the UX surface area
20+
- Testing approach
21+
- Acknowledged but intentionally ignored issues

.github/workflows/benchmark.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Benchmarks
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [main]
7+
paths:
8+
- 'src/rules/**'
9+
- 'benches/**'
10+
- '.github/workflows/benchmark.yml'
11+
12+
env:
13+
CARGO_TERM_COLOR: always
14+
RUST_BACKTRACE: 1
15+
16+
jobs:
17+
benchmark:
18+
runs-on: ubuntu-latest-8-cores
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install Rust
24+
uses: dtolnay/rust-toolchain@stable
25+
with:
26+
toolchain: stable
27+
28+
- name: Setup Rust cache
29+
uses: Swatinem/rust-cache@v2
30+
with:
31+
shared-key: ${{ runner.os }}
32+
# Share cache with other Linux workflows
33+
cache-on-failure: true
34+
# Cache benchmark-specific dependencies
35+
cache-targets: true
36+
cache-all-crates: true
37+
38+
- name: Build benchmarks first (populates cache)
39+
run: cargo build --release --bench rule_engines
40+
41+
- name: Run benchmarks
42+
run: cargo bench --bench rule_engines
43+
44+
- name: Upload benchmark results
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: benchmark-results
48+
path: target/criterion/
49+
retention-days: 30

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ CLAUDE.local.md
55
artifacts/
66
book
77
test-build
8-
mermaid*.js
8+
mermaid*.js
9+
*.pb.gz

0 commit comments

Comments
 (0)