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
Binary file modified .DS_Store
Binary file not shown.
22 changes: 11 additions & 11 deletions .github/workflows/hotpath-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- uses: actions/download-artifact@v4
with:
name: profile-metrics
path: /tmp/metrics/
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}

- name: Install hotpath CLI
run: cargo install hotpath --bin hotpath-ci --features=ci
- name: Install hotpath-utils CLI
run: cargo install hotpath --version ^0.16 --bin hotpath-utils --features=utils

- name: Post PR comment - timing mode
- name: Post PR comment - timing
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
HEAD_METRICS=$(cat /tmp/metrics/head_timing.json)
BASE_METRICS=$(cat /tmp/metrics/base_timing.json)
PR_NUMBER=$(cat /tmp/metrics/pr_number.txt)
hotpath-ci profile-pr \
--head-metrics "$HEAD_METRICS" \
--base-metrics "$BASE_METRICS" \
export GITHUB_BASE_REF=$(cat /tmp/metrics/base_ref.txt)
export GITHUB_HEAD_REF=$(cat /tmp/metrics/head_ref.txt)
hotpath-utils profile-pr \
--head-metrics /tmp/metrics/head_timing.json \
--base-metrics /tmp/metrics/base_timing.json \
--github-token "$GH_TOKEN" \
--pr-number "$PR_NUMBER"

--pr-number "$(cat /tmp/metrics/pr_number.txt)" \
--benchmark-id "timing"
41 changes: 16 additions & 25 deletions .github/workflows/hotpath-profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,29 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- id: head_timing_metrics
- name: Create metrics directory
run: mkdir -p /tmp/metrics

- name: Head benchmark (timing)
env:
HOTPATH_JSON: true
run: |
# Extract timing metrics from head branch
{
echo 'metrics<<EOF'
cargo run --features='hotpath' --profile hotpath --bin andromeda examples/performance.ts | grep '^{"hotpath_profiling_mode"'
echo 'EOF'
} >> "$GITHUB_OUTPUT"
HOTPATH_OUTPUT_FORMAT: json
HOTPATH_OUTPUT_PATH: /tmp/metrics/head_timing.json
run: cargo run --features='hotpath' --profile hotpath --bin andromeda -- run examples/performance.ts

- name: Checkout base
run: |
git checkout ${{ github.event.pull_request.base.sha }}
run: git checkout ${{ github.event.pull_request.base.sha }}

- id: base_timing_metrics
- name: Base benchmark (timing)
env:
HOTPATH_JSON: true
run: |
# Extract timing metrics from base branch
{
echo 'metrics<<EOF'
cargo run --features='hotpath' --profile hotpath --bin andromeda examples/performance.ts | grep '^{"hotpath_profiling_mode"'
echo 'EOF'
} >> "$GITHUB_OUTPUT"

- name: Save metrics to artifact
HOTPATH_OUTPUT_FORMAT: json
HOTPATH_OUTPUT_PATH: /tmp/metrics/base_timing.json
run: cargo run --features='hotpath' --profile hotpath --bin andromeda -- run examples/performance.ts

- name: Save PR metadata
run: |
mkdir -p /tmp/metrics
echo '${{ steps.head_timing_metrics.outputs.metrics }}' > /tmp/metrics/head_timing.json
echo '${{ steps.base_timing_metrics.outputs.metrics }}' > /tmp/metrics/base_timing.json
echo '${{ github.event.pull_request.number }}' > /tmp/metrics/pr_number.txt
echo '${{ github.base_ref }}' > /tmp/metrics/base_ref.txt
echo '${{ github.head_ref }}' > /tmp/metrics/head_ref.txt

- uses: actions/upload-artifact@v4
with:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
./modified.txt
raven.txt
*.demo.png
poe_poem.txt
poe_poem.txt
*.sqlite
Loading
Loading