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
72 changes: 72 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Run benchmarks

on:
pull_request:
types: [labeled]

permissions:
pull-requests: write

jobs:
benchmark:
if: github.event.label.name == 'benchmark'
name: Run criterion benchmarks
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Get data
id: cache-data
uses: actions/cache@v4
with:
path: neopdf-data
key: data-v3

- name: Download data
if: steps.cache-data.outputs.cache-hit != 'true'
run: |
cd maintainer
./download-data.sh

- name: Cache Criterion baseline
uses: actions/cache@v4
with:
path: target/criterion
key: criterion-benchmark-${{ runner.os }}-${{ github.ref }}
restore-keys: |
criterion-benchmark-${{ runner.os }}-refs/heads/main

- name: Run benchmarks and save clean output
id: bench
run: |
export NEOPDF_DATA_PATH=${PWD}/neopdf-data
# The awk command filters out the verbose test summary before the benchmark results.
cargo bench -p neopdf -- --nocapture | awk '/^test result: ok\./ {p=1; next} p' | tee benchmark_results.txt

- name: Post benchmark results as a PR comment
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const output = fs.readFileSync('benchmark_results.txt', 'utf8').trim();

if (output) {
const body = '## 🚀 Benchmark Results 🚀\n\n' +
'Here are the results from the benchmark run.\n\n' +
'```\n' +
output + '\n' +
'```';

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: body
});
} else {
console.log("Benchmark output was empty.");
}
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/cache@v4
with:
path: neopdf-data
key: data-v2
key: data-v3
- name: Download data
if: steps.cache-data.outputs.cache-hit != 'true'
run: |
Expand Down
167 changes: 165 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ flate2 = "1.1.2"
reqwest = { version = "0.12.22", features = ["blocking", "gzip"] }
tar = "0.4.44"
regex = "1.11.1"
git-version = "0.3.9"

# CLI dependencies
clap = { version = "4.5", features = ["derive"] }
Expand All @@ -43,6 +44,7 @@ cbindgen = "0.26.0"
assert_cmd = "2.0.17"
assert_fs = "1.1.3"
predicates = "3.1.3"
criterion = "0.6"

# Internal crates
neopdf = { path = "./neopdf", version = "0.1.0" }
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@

<p align="justify">
<b>NeoPDF</b> is a fast, reliable, and scalable interpolation library for Parton Distribution
Functions (PDFs) with <b>modern features</b> designed for both present and future hadron collider
experiments.
Functions (PDFs) and Transverse Momentum Distributions (TMDs) with <b>modern features</b>
designed for both present and future hadron collider experiments.
</p>

## Quick Links

- [Documentation](https://radonirinaunimi.github.io/neopdf/)
- [Installation](https://radonirinaunimi.github.io/neopdf/installation/)
- [Physics and technical features](https://radonirinaunimi.github.io/neopdf/design-and-features/)
- [Benchmark with LHAPDF](https://radonirinaunimi.github.io/neopdf/design-and-features/#benchmark-against-lhapdf)
- [NeoPDF Design](https://radonirinaunimi.github.io/neopdf/design/)
- [CLI tutorials](https://radonirinaunimi.github.io/neopdf/cli-tutorials/)
- [Tutorials and examples](https://radonirinaunimi.github.io/neopdf/examples/python/)
Loading