Skip to content

chore: profiling harness#478

Open
0xOsiris wants to merge 3 commits into
mainfrom
osiris/profiling
Open

chore: profiling harness#478
0xOsiris wants to merge 3 commits into
mainfrom
osiris/profiling

Conversation

@0xOsiris

@0xOsiris 0xOsiris commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Note

Low Risk
Mostly adds build/CI automation for profiling and PGO and introduces a new profiling cargo profile; runtime behavior is unchanged but build configuration and dependency graph may affect compile times and reproducibility.

Overview
Adds a profiling harness for world-chain, including a new profiling Cargo profile (release-like with full debug symbols) plus cargo/just helpers for native builds, profiling benchmarks, and profiling/maxperf Docker images.

Introduces PGO automation via Justfile targets and a new .github/scripts/build_pgo.sh script to build instrumented binaries, collect .profraw via benchmarks, merge to .profdata, and rebuild with profile use.

Adds a new manually-triggered GitHub Actions workflow profiling.yml to build and upload profiling binaries (and optionally run the full PGO pipeline), and updates test-utils to include alloy-rpc-client (with the corresponding Cargo.lock change).

Written by Cursor Bugbot for commit 8a937ae. Configure here.

Comment thread .github/workflows/profiling.yml

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is kicking off a free cloud agent to fix this issue. This run is complimentary, but you can enable autofix for all future PRs in the Cursor dashboard.

Comment thread Justfile Outdated
@github-actions

github-actions Bot commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results

Compared on the same runner in the same workflow run.

group                                                                                              base                                   pr
-----                                                                                              ----                                   --
flashblock_validation_launch_flashblock_sequence_eth_transfers/stream/4fb_x_125tx                  1.00     28.2±0.44ms        ? ?/sec    1.00     28.1±0.26ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_eth_transfers/stream/4fb_x_250tx                  1.01     56.6±0.93ms        ? ?/sec    1.00     55.9±0.50ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_eth_transfers/stream/4fb_x_50tx                   1.01     11.6±0.08ms        ? ?/sec    1.00     11.5±0.10ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_eth_transfers_with_bal/stream/4fb_x_125tx         1.00     35.0±0.52ms        ? ?/sec    1.07     37.6±1.64ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_eth_transfers_with_bal/stream/4fb_x_250tx         1.00     66.4±0.85ms        ? ?/sec    1.02     67.7±0.88ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_eth_transfers_with_bal/stream/4fb_x_50tx          1.06     17.1±0.50ms        ? ?/sec    1.00     16.1±0.16ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_fib/stream/4fb_x_125tx                            1.00     26.5±0.07ms        ? ?/sec    1.05     27.8±0.79ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_fib/stream/4fb_x_250tx                            1.00     52.4±0.21ms        ? ?/sec    1.05     54.9±0.25ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_fib/stream/4fb_x_50tx                             1.00     10.9±0.04ms        ? ?/sec    1.07     11.6±0.78ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_fib_with_bal/stream/4fb_x_125tx                   1.00     34.1±1.22ms        ? ?/sec    1.00     34.0±0.61ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_fib_with_bal/stream/4fb_x_250tx                   1.00     63.5±1.56ms        ? ?/sec    1.01     64.3±1.13ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_fib_with_bal/stream/4fb_x_50tx                    1.01     15.6±0.55ms        ? ?/sec    1.00     15.3±0.26ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_world_id_like_bn254/stream/4fb_x_10tx             1.00    136.4±1.53ms        ? ?/sec    1.00    136.0±0.60ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_world_id_like_bn254/stream/4fb_x_12tx             1.00    162.9±0.31ms        ? ?/sec    1.00    162.9±1.35ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_world_id_like_bn254/stream/4fb_x_5tx              1.00     68.4±0.47ms        ? ?/sec    1.00     68.4±0.20ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_world_id_like_bn254_with_bal/stream/4fb_x_10tx    1.01     24.3±1.43ms        ? ?/sec    1.00     24.2±1.34ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_world_id_like_bn254_with_bal/stream/4fb_x_12tx    1.00     25.3±1.76ms        ? ?/sec    1.06     26.7±1.34ms        ? ?/sec
flashblock_validation_launch_flashblock_sequence_world_id_like_bn254_with_bal/stream/4fb_x_5tx     1.01     19.1±0.54ms        ? ?/sec    1.00     19.0±0.88ms        ? ?/sec
flashblock_validation_process_flashblock_eth_transfers/txs/1000                                    1.00     48.8±0.15ms        ? ?/sec    1.00     48.9±0.15ms        ? ?/sec
flashblock_validation_process_flashblock_eth_transfers/txs/50                                      1.01      2.6±0.02ms        ? ?/sec    1.00      2.6±0.01ms        ? ?/sec
flashblock_validation_process_flashblock_eth_transfers/txs/500                                     1.00     24.5±0.30ms        ? ?/sec    1.00     24.5±0.10ms        ? ?/sec
flashblock_validation_process_flashblock_eth_transfers_with_bal/txs/1000                           1.02     60.9±0.76ms        ? ?/sec    1.00     60.0±0.55ms        ? ?/sec
flashblock_validation_process_flashblock_eth_transfers_with_bal/txs/50                             1.03      3.9±0.15ms        ? ?/sec    1.00      3.8±0.10ms        ? ?/sec
flashblock_validation_process_flashblock_eth_transfers_with_bal/txs/500                            1.00     29.6±0.44ms        ? ?/sec    1.00     29.6±0.21ms        ? ?/sec
flashblock_validation_process_flashblock_fib/txs/1000                                              1.00     48.2±0.35ms        ? ?/sec    1.00     48.0±0.25ms        ? ?/sec
flashblock_validation_process_flashblock_fib/txs/50                                                1.01      2.5±0.01ms        ? ?/sec    1.00      2.4±0.00ms        ? ?/sec
flashblock_validation_process_flashblock_fib/txs/500                                               1.00     24.0±0.07ms        ? ?/sec    1.00     24.0±0.13ms        ? ?/sec
flashblock_validation_process_flashblock_fib_with_bal/txs/1000                                     1.00     56.5±0.57ms        ? ?/sec    1.01     57.2±0.59ms        ? ?/sec
flashblock_validation_process_flashblock_fib_with_bal/txs/50                                       1.05      3.9±0.19ms        ? ?/sec    1.00      3.7±0.06ms        ? ?/sec
flashblock_validation_process_flashblock_fib_with_bal/txs/500                                      1.00     28.9±0.73ms        ? ?/sec    1.03     29.7±0.48ms        ? ?/sec
flashblock_validation_process_flashblock_world_id_like_bn254/txs/10                                1.00     33.8±0.14ms        ? ?/sec    1.00     33.8±0.09ms        ? ?/sec
flashblock_validation_process_flashblock_world_id_like_bn254/txs/25                                1.00     84.5±0.27ms        ? ?/sec    1.00     84.3±0.26ms        ? ?/sec
flashblock_validation_process_flashblock_world_id_like_bn254/txs/50                                1.00    168.5±0.43ms        ? ?/sec    1.00    168.4±0.80ms        ? ?/sec
flashblock_validation_process_flashblock_world_id_like_bn254_with_bal/txs/10                       1.00      5.6±0.42ms        ? ?/sec    1.04      5.8±0.33ms        ? ?/sec
flashblock_validation_process_flashblock_world_id_like_bn254_with_bal/txs/25                       1.01      8.1±0.10ms        ? ?/sec    1.00      8.0±0.12ms        ? ?/sec
flashblock_validation_process_flashblock_world_id_like_bn254_with_bal/txs/50                       1.00     14.9±0.18ms        ? ?/sec    1.01     15.0±0.12ms        ? ?/sec

Threshold: 10% regression triggers failure

@0xOsiris 0xOsiris requested a review from Kemperino as a code owner May 5, 2026 00:57
Comment thread .github/workflows/profiling.yml
RUSTFLAGS="-Cprofile-generate=$PGO_DATA_DIR -C target-cpu=native $EXTRA_RUSTFLAGS" \
cargo bench --profile "$PROFILE_BUILD" \
--package world-chain-builder \
--bench coordinator \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no coordinator bench

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are:

help: available bench targets:
    flashblock_building_live_node
    flashblock_validation_live_node
    flashblock_validation_synthetic

What was previuously called coordinator is now called flashblock_validation_synthetic

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest live node benches though as they are more reliable and mimic more closely mainnet behaviours

Comment thread .cargo/config.toml
b = "bench --package builder --bench coordinator --"
bs = "bench --package builder --bench coordinator -- --save-baseline"
bc = "bench --package builder --bench coordinator -- --baseline main --save-baseline pr"
bench = "bench --package builder --bench coordinator --"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here and below, there is no coordinator bench

RUSTFLAGS="-Cprofile-generate=/tmp/pgo-data -C target-cpu=native" \
cargo bench --profile profiling \
--package world-chain-builder \
--bench coordinator \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants