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
73 changes: 0 additions & 73 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ concurrency:

permissions: {}

env:
UV_VERSION: "0.8.22"
NODE_VERSION: "20"
GO_VERSION: "1.24"
PYTHON_VERSION: "3.12"
LUA_VERSION: "5.4"
LUAROCKS_VERSION: "3.12.2"

jobs:
bloat-check:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -104,68 +96,3 @@ jobs:
with:
name: bloat-check-results
path: /tmp/bloat-check

hotpath-profile:
runs-on: ubuntu-latest
name: "cargo | hotpath profiling"
timeout-minutes: 15
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
persist-credentials: false
fetch-depth: 0
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1

- name: "Install uv"
uses: astral-sh/setup-uv@b75a909f75acd358c2196fb9a5f1299a9a8868a4 # v6.7.0
with:
version: ${{ env.UV_VERSION }}

- name: "Install Python"
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Profile head timings
run: |
# Extract timing metrics from HEAD (PR branch)
# Run first to setup caches
cargo run --profile profiling --locked --features hotpath,hotpath-ci -- --all-files trailing-whitespace
cargo run --profile profiling --locked --features hotpath,hotpath-ci -- --all-files trailing-whitespace | grep '^{"hotpath_profiling_mode"' > head-timing.json

- name: Profile head allocations
run: |
# Extract allocation metrics from HEAD (PR branch)
cargo run --profile profiling --locked --features hotpath,hotpath-ci,hotpath-alloc-count-total -- --all-files trailing-whitespace | grep '^{"hotpath_profiling_mode"' > head-alloc.json

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

- name: Profile base timings
run: |
# Extract timing metrics from base branch
# Run first to setup caches
cargo run --profile profiling --locked --features hotpath,hotpath-ci -- --all-files trailing-whitespace
cargo run --profile profiling --locked --features hotpath,hotpath-ci -- --all-files trailing-whitespace | grep '^{"hotpath_profiling_mode"' > base-timing.json

- name: Profile base allocations
run: |
# Extract allocation metrics from base branch
cargo run --profile profiling --locked --features hotpath,hotpath-ci,hotpath-alloc-count-total -- --all-files trailing-whitespace | grep '^{"hotpath_profiling_mode"' > base-alloc.json

- name: Save hotpath comparison results
run: |
mkdir -p /tmp/hotpath
echo ${{ github.event.pull_request.number }} > /tmp/hotpath/pr-number.txt
mv head-timing.json /tmp/hotpath/head-timing.json
mv head-alloc.json /tmp/hotpath/head-alloc.json
mv base-timing.json /tmp/hotpath/base-timing.json
mv base-alloc.json /tmp/hotpath/base-alloc.json

- name: Upload hotpath results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: hotpath-results
path: /tmp/hotpath
47 changes: 1 addition & 46 deletions .github/workflows/pr-comment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow comments on a PR with the results of the `cargo bloat check` and `hotpath profiling` performed in the CI workflow.
# This workflow comments on a PR with the results of the `cargo bloat check` performed in the performance workflow.
# This is a workaround for the limitations imposed by GitHub Actions on workflows triggered by pull requests from forked repositories.

# The restrictions apply to the pull_request event triggered by a fork opening a pull request in the upstream repository.
Expand Down Expand Up @@ -69,48 +69,3 @@ jobs:
body,
});
}

hotpath-comment:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with:
name: hotpath-results
path: /tmp/hotpath/
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id || github.event.inputs.workflow_run_id }}

- name: Install hotpath
uses: taiki-e/install-action@5ab30948b991e8d6aa5a6c1e33c6aea130c6de65 # v2.62.12
with:
tool: hotpath

- name: Post PR comment - timing mode
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
HEAD_METRICS=$(cat /tmp/hotpath/head-timing.json)
BASE_METRICS=$(cat /tmp/hotpath/base-timing.json)
PR_NUMBER=$(cat /tmp/hotpath/pr-number.txt)
hotpath profile-pr \
--head-metrics "$HEAD_METRICS" \
--base-metrics "$BASE_METRICS" \
--github-token "$GH_TOKEN" \
--pr-number "$PR_NUMBER"

- name: Post PR comment - alloc mode
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
HEAD_METRICS=$(cat /tmp/hotpath/head-alloc.json)
BASE_METRICS=$(cat /tmp/hotpath/base-alloc.json)
PR_NUMBER=$(cat /tmp/hotpath/pr-number.txt)
hotpath profile-pr \
--head-metrics "$HEAD_METRICS" \
--base-metrics "$BASE_METRICS" \
--github-token "$GH_TOKEN" \
--pr-number "$PR_NUMBER"
Loading
Loading