Skip to content

Commit

Permalink
Merge branch 'main' into complete-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
SRv6d committed Dec 9, 2023
2 parents 3725781 + ca0652d commit 7f8140f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
29 changes: 15 additions & 14 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,26 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

concurrency:
group: >-
${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number
|| github.sha }}
cancel-in-progress: true

env:
COLUMNS: 120
HYPERFINE_VERSION: "1.17.0"

jobs:
cargo-bench:
runs-on: ubuntu-22.04
benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: run benchmark
run: cargo bench
- name: Setup rust toolchain, cache and cargo-codspeed binary
uses: moonrepo/setup-rust@v1
with:
channel: stable
cache-target: release
bins: cargo-codspeed
- name: Build the benchmark target(s)
run: cargo codspeed build
- name: Run the benchmarks
uses: CodSpeedHQ/action@v2
with:
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ nom = "7.1.3"
thiserror = "1.0.50"

[dev-dependencies]
codspeed-criterion-compat = "2.3.3"
criterion = { version = "0.5.1", features = ["html_reports"] }

[[bench]]
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<a href="https://github.com/srv6d/rpsl-parser/actions">
<img src="https://github.com/srv6d/rpsl-parser/workflows/CI/badge.svg" alt="CI status">
</a>
<a href="https://codspeed.io/SRv6d/rpsl-parser">
<img src="https://img.shields.io/endpoint?url=https://codspeed.io/badge.json" alt="CodSpeed Badge">
</a>
<a href="https://crates.io/crates/rpsl-parser">
<img src="https://img.shields.io/crates/v/rpsl-parser.svg" alt="Cargo version">
</a>
Expand All @@ -22,6 +25,8 @@ An [RFC 2622] conformant Routing Policy Specification Language (RPSL) parser wit
> [!WARNING]
> This project is still in early stages of development and its API is not yet stable.
[**Docs**](https://docs.rs/rpsl-parser/latest/rpsl_parser/) | [**Performance**](https://github.com/SRv6d/rpsl-parser/tree/main/docs/benchmark)

## Usage

### Parsing RPSL objects
Expand Down
2 changes: 1 addition & 1 deletion benches/parse_as3257.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Criterion};

pub fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("parse AS3257", |b| {
Expand Down

0 comments on commit 7f8140f

Please sign in to comment.