Skip to content

chore(deps): bump the actions-updates group across 1 directory with 7 updates #90

chore(deps): bump the actions-updates group across 1 directory with 7 updates

chore(deps): bump the actions-updates group across 1 directory with 7 updates #90

Workflow file for this run

name: Performance
on:
pull_request:
branches: [main]
paths:
- ".github/workflows/performance.yml"
- ".cargo/**"
- "Cargo.lock"
- "Cargo.toml"
- "crates/**"
- "rust-toolchain.toml"
- "scripts/perf/**"
schedule:
- cron: "0 4 * * 1" # Weekly on Monday at 04:00 UTC
workflow_dispatch:
permissions: {}
concurrency:
group: performance-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
jobs:
regression:
name: Coarse regression gate
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read # checkout the PR and its base revision
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Install Rust stable
run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup override set stable
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
save-if: false
- name: Prepare artifact directory
run: mkdir -p "${RUNNER_TEMP}/performance"
- name: Materialize pinned fixtures
run: scripts/perf/fetch-fixtures.sh "${RUNNER_TEMP}/fixtures" 2000
- name: Build PR and base binaries
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
cargo build --release --all-features --locked -p rsigma
git worktree add "${RUNNER_TEMP}/base" "${BASE_SHA}"
CARGO_TARGET_DIR="${RUNNER_TEMP}/base-target" \
cargo build --manifest-path "${RUNNER_TEMP}/base/Cargo.toml" \
--release --all-features --locked -p rsigma
- name: Measure base and PR
run: |
RSIGMA="${RUNNER_TEMP}/base-target/release/rsigma" REPEAT=5 RUNS=3 \
SAMPLES_FILE="${RUNNER_TEMP}/performance/base-samples.tsv" \
scripts/perf/baseline-eval.sh "${RUNNER_TEMP}/fixtures" \
raw_windows structured_windows cisco_syslog sysmon_file_event \
> "${RUNNER_TEMP}/performance/base.tsv"
RSIGMA="${GITHUB_WORKSPACE}/target/release/rsigma" REPEAT=5 RUNS=3 \
SAMPLES_FILE="${RUNNER_TEMP}/performance/head-samples.tsv" \
scripts/perf/baseline-eval.sh "${RUNNER_TEMP}/fixtures" \
raw_windows structured_windows cisco_syslog sysmon_file_event \
> "${RUNNER_TEMP}/performance/head.tsv"
scripts/perf/check-regression.py \
"${RUNNER_TEMP}/performance/base.tsv" \
"${RUNNER_TEMP}/performance/head.tsv" \
--minimum-ratio 0.5
- name: Measure candidate-index rate
env:
RSIGMA_DIFF_EVENT_LIMIT: "2000"
run: |
RSIGMA_DIFF_RULES="${RUNNER_TEMP}/fixtures/sigma/rules" \
RSIGMA_DIFF_EVENTS="${RUNNER_TEMP}/fixtures/events" \
cargo test -p rsigma-eval --all-features --locked \
corpus_candidate_rate -- --ignored --nocapture \
2>&1 | tee "${RUNNER_TEMP}/performance/candidate-rate.txt"
- name: Upload raw measurements
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: performance-regression-${{ github.event.pull_request.number }}
path: ${{ runner.temp }}/performance/
if-no-files-found: error
retention-days: 14
measurements:
name: Scheduled measurements
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: read # checkout the measured revision
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust stable
run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup override set stable
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Prepare artifact directory
run: mkdir -p "${RUNNER_TEMP}/performance"
- name: Materialize pinned fixtures
run: scripts/perf/fetch-fixtures.sh "${RUNNER_TEMP}/fixtures" 10000
- name: Build release binary
run: cargo build --release --all-features --locked -p rsigma
- name: Run offline matrix
run: |
REPEAT=10 RUNS=5 \
SAMPLES_FILE="${RUNNER_TEMP}/performance/offline-samples.tsv" \
scripts/perf/baseline-eval.sh \
"${RUNNER_TEMP}/fixtures" \
raw_windows structured_windows cisco_syslog sysmon_file_event \
> "${RUNNER_TEMP}/performance/offline.tsv"
- name: Run daemon matrix
env:
BATCH_SIZE: "128"
DURATION: 10s
LOAD_DRIVER: python
run: |
scripts/perf/daemon-matrix.sh "${RUNNER_TEMP}/fixtures" \
| tee "${RUNNER_TEMP}/performance/daemon.txt"
- name: Measure candidate-index rate
env:
RSIGMA_DIFF_EVENT_LIMIT: "10000"
run: |
RSIGMA_DIFF_RULES="${RUNNER_TEMP}/fixtures/sigma/rules" \
RSIGMA_DIFF_EVENTS="${RUNNER_TEMP}/fixtures/events" \
cargo test -p rsigma-eval --all-features --locked \
corpus_candidate_rate -- --ignored --nocapture \
2>&1 | tee "${RUNNER_TEMP}/performance/candidate-rate.txt"
- name: Record revision and runner
if: always()
run: |
mkdir -p "${RUNNER_TEMP}/performance"
{
echo "sha=${GITHUB_SHA}"
uname -a
rustc --version --verbose
} > "${RUNNER_TEMP}/performance/environment.txt"
- name: Upload raw measurements
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: performance-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/performance/
if-no-files-found: error
retention-days: 90
artifact-scaling:
name: Artifact scaling (${{ matrix.arch }})
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
env:
ARTIFACT_ARCH: ${{ matrix.arch }}
permissions:
contents: read # checkout the trusted scheduled/manually selected revision
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
runner: rsigma-perf-amd64-8
target: x86_64-unknown-linux-gnu
- arch: arm64
runner: rsigma-perf-arm64-8
target: aarch64-unknown-linux-gnu
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust stable and target
env:
TARGET: ${{ matrix.target }}
run: |
rustup toolchain install stable --profile minimal --no-self-update
rustup override set stable
rustup target add "${TARGET}"
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Verify performance runner
run: |
cores="$(nproc)"
if [ "${cores}" -lt 8 ]; then
echo "artifact scaling requires at least 8 logical CPUs, found ${cores}" >&2
exit 1
fi
- name: Prepare fixtures and artifacts
run: |
mkdir -p "${RUNNER_TEMP}/performance"
scripts/perf/fetch-fixtures.sh "${RUNNER_TEMP}/fixtures" 2000
- name: Build glibc release artifact
env:
TARGET: ${{ matrix.target }}
run: cargo build --release --all-features --locked --target "${TARGET}" -p rsigma
- name: Build and extract musl image artifact
env:
IMAGE: rsigma:perf-musl-${{ matrix.arch }}-${{ github.run_id }}
run: |
docker build --load -t "${IMAGE}" .
container="$(docker create "${IMAGE}")"
trap 'docker rm -f "${container}" >/dev/null 2>&1 || true' EXIT
docker cp "${container}:/rsigma" "${RUNNER_TEMP}/rsigma-musl"
chmod +x "${RUNNER_TEMP}/rsigma-musl"
- name: Compare glibc in-flight depths
env:
BATCH: "500"
BATCH_SIZE: "512"
DURATION: 10s
LOAD_DRIVER: python
MAX_BACKPRESSURE_DELTA: "0.008"
MINIMUM_RATIO: "0.98"
RAYON_NUM_THREADS: "8"
RUNS: "5"
VUS: "16"
TARGET: ${{ matrix.target }}
run: |
scripts/perf/inflight-compare.sh \
"${RUNNER_TEMP}/fixtures" \
"target/${TARGET}/release/rsigma" \
| tee "${RUNNER_TEMP}/performance/glibc-${ARTIFACT_ARCH}.tsv"
- name: Compare musl in-flight depths
env:
BATCH: "500"
BATCH_SIZE: "512"
DURATION: 10s
LOAD_DRIVER: python
MAX_BACKPRESSURE_DELTA: "0.008"
MINIMUM_RATIO: "0.98"
RAYON_NUM_THREADS: "8"
RUNS: "5"
VUS: "16"
run: |
scripts/perf/inflight-compare.sh \
"${RUNNER_TEMP}/fixtures" \
"${RUNNER_TEMP}/rsigma-musl" \
| tee "${RUNNER_TEMP}/performance/musl-${ARTIFACT_ARCH}.tsv"
- name: Record environment
if: always()
run: |
{
echo "sha=${GITHUB_SHA}"
uname -a
nproc
lscpu
rustc --version --verbose
docker version
} > "${RUNNER_TEMP}/performance/environment-${ARTIFACT_ARCH}.txt"
- name: Remove benchmark image
if: always()
env:
IMAGE: rsigma:perf-musl-${{ matrix.arch }}-${{ github.run_id }}
run: docker image rm -f "${IMAGE}" >/dev/null 2>&1 || true
- name: Upload artifact measurements
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: artifact-scaling-${{ matrix.arch }}-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/performance/
if-no-files-found: error
retention-days: 90