Skip to content

Expand process benchmarks across lifecycle phases and topologies - #302

Open
toby-coleman wants to merge 2 commits into
mainfrom
worktree/rapid-stone-54f6
Open

toby-coleman wants to merge 2 commits into
mainfrom
worktree/rapid-stone-54f6

Conversation

@toby-coleman

Copy link
Copy Markdown
Contributor

The existing benchmark times one three-component pipeline, skips initialization, runs setup and execution on separate event loops, and never destroys the process. Replace it with 24 cases covering initialization, execution, and the full lifecycle across short/deep chains, narrow/wide fan-out and fan-in, a diamond, and a seeded feedback loop.

Dedicated lightweight components use the production run loop. Every round creates a fresh graph and keeps construction, initialization, execution, and destruction on the same event loop. Counts, checksums, and completion statuses are checked outside the timer, and cleanup also runs when setup/execution fails or benchmarks are disabled.

Document timing boundaries, workload sizes, local in-memory scope, and the existing one-second initialization delay. New case IDs gain a comparison baseline once merged.

Validation:

  • 24 timed benchmark cases, five rounds each; JSON results inspected.
  • 24 cases passed with --benchmark-disable.
  • Three regression tests passed for cleanup and event-loop ownership after failures.
  • Ruff lint/format and ty checks passed for changed Python files.

No production framework code changed.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-25T14:17:34.562707Z 0d78781 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

Benchmark comparison for 2cf84111 (base) vs 0d787814 (PR)


------------------------------------------------------------------------------- benchmark: 1 tests ------------------------------------------------------------------------------
Name (time in ms)                                                                         Min       Max      Mean  StdDev    Median     IQR  Outliers     OPS  Rounds  Iterations
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_process_run (main/.benchmarks/Linux-CPython-3.14-64bit/0001_base)     250.4407  257.9413  255.3889  3.0086  255.7176  3.7009       1;0  3.9156       5           1
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------- benchmark 'init': 8 tests ---------------------------------------------------------------------------------------------------------------
Name (time in s)                                                                                 Min               Max              Mean            StdDev            Median               IQR            Outliers     OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_process[init-fan_out-2] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)      1.0031 (1.0)      1.0040 (1.00)     1.0035 (1.00)     0.0004 (4.88)     1.0035 (1.00)     0.0005 (3.75)          2;0  0.9965 (1.00)          5           1
test_benchmark_process[init-chain-3] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)        1.0031 (1.00)     1.0040 (1.00)     1.0033 (1.00)     0.0004 (5.21)     1.0032 (1.00)     0.0003 (1.96)          1;1  0.9967 (1.00)          5           1
test_benchmark_process[init-fan_in-2] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)       1.0031 (1.00)     1.0034 (1.0)      1.0032 (1.0)      0.0001 (1.19)     1.0032 (1.0)      0.0001 (1.01)          1;0  0.9968 (1.0)           5           1
test_benchmark_process[init-feedback-3] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)     1.0032 (1.00)     1.0034 (1.00)     1.0033 (1.00)     0.0001 (1.0)      1.0033 (1.00)     0.0001 (1.0)           2;0  0.9967 (1.00)          5           1
test_benchmark_process[init-diamond-4] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)      1.0036 (1.00)     1.0038 (1.00)     1.0037 (1.00)     0.0001 (1.29)     1.0038 (1.00)     0.0001 (1.12)          2;0  0.9963 (1.00)          5           1
test_benchmark_process[init-chain-16] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)       1.0096 (1.01)     1.0118 (1.01)     1.0103 (1.01)     0.0010 (13.05)    1.0098 (1.01)     0.0016 (11.69)         1;0  0.9898 (0.99)          5           1
test_benchmark_process[init-fan_in-16] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)      1.0096 (1.01)     1.0105 (1.01)     1.0100 (1.01)     0.0004 (5.16)     1.0101 (1.01)     0.0006 (4.81)          2;0  0.9901 (0.99)          5           1
test_benchmark_process[init-fan_out-16] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)     1.0097 (1.01)     1.0115 (1.01)     1.0103 (1.01)     0.0007 (9.31)     1.0101 (1.01)     0.0006 (4.90)          1;1  0.9898 (0.99)          5           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------- benchmark 'lifecycle': 8 tests --------------------------------------------------------------------------------------------------------------
Name (time in s)                                                                                      Min               Max              Mean            StdDev            Median               IQR            Outliers     OPS            Rounds  Iterations
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_process[lifecycle-fan_out-2] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)      1.2483 (1.0)      1.2633 (1.00)     1.2547 (1.0)      0.0061 (3.95)     1.2537 (1.0)      0.0095 (6.33)          2;0  0.7970 (1.0)           5           1
test_benchmark_process[lifecycle-chain-3] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)        1.2581 (1.01)     1.2624 (1.0)      1.2602 (1.00)     0.0015 (1.0)      1.2602 (1.01)     0.0015 (1.0)           2;0  0.7935 (1.00)          5           1
test_benchmark_process[lifecycle-feedback-3] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)     1.2791 (1.02)     1.3014 (1.03)     1.2885 (1.03)     0.0095 (6.22)     1.2864 (1.03)     0.0164 (10.90)         1;0  0.7761 (0.97)          5           1
test_benchmark_process[lifecycle-fan_in-2] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)       1.3275 (1.06)     1.3388 (1.06)     1.3341 (1.06)     0.0050 (3.29)     1.3364 (1.07)     0.0086 (5.72)          1;0  0.7496 (0.94)          5           1
test_benchmark_process[lifecycle-diamond-4] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)      1.3539 (1.08)     1.3986 (1.11)     1.3654 (1.09)     0.0187 (12.20)    1.3578 (1.08)     0.0142 (9.42)          1;1  0.7324 (0.92)          5           1
test_benchmark_process[lifecycle-fan_out-16] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)     2.2195 (1.78)     2.2572 (1.79)     2.2333 (1.78)     0.0154 (10.05)    2.2342 (1.78)     0.0213 (14.13)         1;0  0.4478 (0.56)          5           1
test_benchmark_process[lifecycle-chain-16] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)       2.4537 (1.97)     2.4875 (1.97)     2.4707 (1.97)     0.0131 (8.52)     2.4683 (1.97)     0.0192 (12.73)         2;0  0.4047 (0.51)          5           1
test_benchmark_process[lifecycle-fan_in-16] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)      3.5663 (2.86)     3.6202 (2.87)     3.5910 (2.86)     0.0203 (13.22)    3.5940 (2.87)     0.0264 (17.53)         2;0  0.2785 (0.35)          5           1
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------------------------------ benchmark 'run': 8 tests ------------------------------------------------------------------------------------------------------------------------
Name (time in ms)                                                                                   Min                   Max                  Mean              StdDev                Median                IQR            Outliers     OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_process[run-fan_out-2] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)        246.4732 (1.0)        507.5246 (1.85)       300.3608 (1.14)     115.8214 (22.67)      248.6206 (1.0)      67.8214 (11.48)         1;1  3.3293 (0.87)          5           1
test_benchmark_process[run-chain-3] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)          248.8593 (1.01)       273.6675 (1.0)        262.6085 (1.0)       10.0545 (1.97)       261.6435 (1.05)     16.0051 (2.71)          2;0  3.8079 (1.0)           5           1
test_benchmark_process[run-feedback-3] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)       276.4159 (1.12)       315.0438 (1.15)       287.0149 (1.09)      16.0224 (3.14)       279.3592 (1.12)     14.6918 (2.49)          1;1  3.4841 (0.91)          5           1
test_benchmark_process[run-fan_in-2] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)         328.7270 (1.33)       360.5063 (1.32)       341.1582 (1.30)      13.0133 (2.55)       341.6519 (1.37)     19.6021 (3.32)          1;0  2.9312 (0.77)          5           1
test_benchmark_process[run-diamond-4] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)        354.4307 (1.44)       367.0211 (1.34)       358.3948 (1.36)       5.1083 (1.0)        356.4419 (1.43)      5.9067 (1.0)           1;0  2.7902 (0.73)          5           1
test_benchmark_process[run-fan_out-16] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)     1,218.7799 (4.94)     1,246.0239 (4.55)     1,229.0061 (4.68)      11.4618 (2.24)     1,224.0321 (4.92)     17.6750 (2.99)          1;0  0.8137 (0.21)          5           1
test_benchmark_process[run-chain-16] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)       1,455.2397 (5.90)     1,537.5368 (5.62)     1,498.7803 (5.71)      34.0764 (6.67)     1,486.2026 (5.98)     53.0594 (8.98)          2;0  0.6672 (0.18)          5           1
test_benchmark_process[run-fan_in-16] (pr/.benchmarks/Linux-CPython-3.14-64bit/0001_pr)      2,549.1229 (10.34)    2,596.3226 (9.49)     2,573.8159 (9.80)      17.1401 (3.36)     2,577.3580 (10.37)    18.9441 (3.21)          2;0  0.3885 (0.10)          5           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Legend:
  Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
  OPS: Operations Per Second, computed as 1 / Mean

@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
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.

1 participant