Skip to content

Commit 6924e13

Browse files
authored
feat(ext/workers): web workers (#216)
* fix: server break * chore: bump version * feat(ext/workers): web workers * chore: fmt * chore: bump deps * chore: bump hotpath
1 parent 4129c45 commit 6924e13

58 files changed

Lines changed: 4302 additions & 394 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.DS_Store

0 Bytes
Binary file not shown.

.github/workflows/hotpath-comment.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ jobs:
1818
- uses: actions/checkout@v4
1919
- uses: dtolnay/rust-toolchain@stable
2020
- uses: Swatinem/rust-cache@v2
21+
2122
- uses: actions/download-artifact@v4
2223
with:
2324
name: profile-metrics
2425
path: /tmp/metrics/
2526
github-token: ${{ secrets.GITHUB_TOKEN }}
2627
run-id: ${{ github.event.workflow_run.id }}
2728

28-
- name: Install hotpath CLI
29-
run: cargo install hotpath --bin hotpath-ci --features=ci
29+
- name: Install hotpath-utils CLI
30+
run: cargo install hotpath --version ^0.16 --bin hotpath-utils --features=utils
3031

31-
- name: Post PR comment - timing mode
32+
- name: Post PR comment - timing
3233
env:
3334
GH_TOKEN: ${{ github.token }}
3435
run: |
3536
set -euo pipefail
36-
HEAD_METRICS=$(cat /tmp/metrics/head_timing.json)
37-
BASE_METRICS=$(cat /tmp/metrics/base_timing.json)
38-
PR_NUMBER=$(cat /tmp/metrics/pr_number.txt)
39-
hotpath-ci profile-pr \
40-
--head-metrics "$HEAD_METRICS" \
41-
--base-metrics "$BASE_METRICS" \
37+
export GITHUB_BASE_REF=$(cat /tmp/metrics/base_ref.txt)
38+
export GITHUB_HEAD_REF=$(cat /tmp/metrics/head_ref.txt)
39+
hotpath-utils profile-pr \
40+
--head-metrics /tmp/metrics/head_timing.json \
41+
--base-metrics /tmp/metrics/base_timing.json \
4242
--github-token "$GH_TOKEN" \
43-
--pr-number "$PR_NUMBER"
44-
43+
--pr-number "$(cat /tmp/metrics/pr_number.txt)" \
44+
--benchmark-id "timing"

.github/workflows/hotpath-profile.yml

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,29 @@ jobs:
1717
- uses: dtolnay/rust-toolchain@stable
1818
- uses: Swatinem/rust-cache@v2
1919

20-
- id: head_timing_metrics
20+
- name: Create metrics directory
21+
run: mkdir -p /tmp/metrics
22+
23+
- name: Head benchmark (timing)
2124
env:
22-
HOTPATH_JSON: true
23-
run: |
24-
# Extract timing metrics from head branch
25-
{
26-
echo 'metrics<<EOF'
27-
cargo run --features='hotpath' --profile hotpath --bin andromeda examples/performance.ts | grep '^{"hotpath_profiling_mode"'
28-
echo 'EOF'
29-
} >> "$GITHUB_OUTPUT"
25+
HOTPATH_OUTPUT_FORMAT: json
26+
HOTPATH_OUTPUT_PATH: /tmp/metrics/head_timing.json
27+
run: cargo run --features='hotpath' --profile hotpath --bin andromeda -- run examples/performance.ts
3028

3129
- name: Checkout base
32-
run: |
33-
git checkout ${{ github.event.pull_request.base.sha }}
30+
run: git checkout ${{ github.event.pull_request.base.sha }}
3431

35-
- id: base_timing_metrics
32+
- name: Base benchmark (timing)
3633
env:
37-
HOTPATH_JSON: true
38-
run: |
39-
# Extract timing metrics from base branch
40-
{
41-
echo 'metrics<<EOF'
42-
cargo run --features='hotpath' --profile hotpath --bin andromeda examples/performance.ts | grep '^{"hotpath_profiling_mode"'
43-
echo 'EOF'
44-
} >> "$GITHUB_OUTPUT"
45-
46-
- name: Save metrics to artifact
34+
HOTPATH_OUTPUT_FORMAT: json
35+
HOTPATH_OUTPUT_PATH: /tmp/metrics/base_timing.json
36+
run: cargo run --features='hotpath' --profile hotpath --bin andromeda -- run examples/performance.ts
37+
38+
- name: Save PR metadata
4739
run: |
48-
mkdir -p /tmp/metrics
49-
echo '${{ steps.head_timing_metrics.outputs.metrics }}' > /tmp/metrics/head_timing.json
50-
echo '${{ steps.base_timing_metrics.outputs.metrics }}' > /tmp/metrics/base_timing.json
5140
echo '${{ github.event.pull_request.number }}' > /tmp/metrics/pr_number.txt
41+
echo '${{ github.base_ref }}' > /tmp/metrics/base_ref.txt
42+
echo '${{ github.head_ref }}' > /tmp/metrics/head_ref.txt
5243
5344
- uses: actions/upload-artifact@v4
5445
with:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
./modified.txt
33
raven.txt
44
*.demo.png
5-
poe_poem.txt
5+
poe_poem.txt
6+
*.sqlite

0 commit comments

Comments
 (0)