@@ -64,61 +64,60 @@ jobs:
6464 - run : gcloud storage cp -r gs://committer-testing-artifacts/$BENCH_INPUT_FILES_PREFIX/* ./crates/starknet_committer_and_os_cli/test_inputs
6565 - run : cargo test -p starknet_committer_and_os_cli --release -- --include-ignored test_regression
6666
67- # TODO(Aviv): Uncomment.
68- # benchmarking:
69- # runs-on: namespace-profile-medium-ubuntu-24-04-amd64
70- # if: ${{ github.event_name == 'pull_request' }}
71- # steps:
72- # # Checkout the base branch to benchmark the old code.
73- # - uses: actions/checkout@v4
74- # with:
75- # ref: ${{ github.base_ref }}
76-
77- # # Setup pypy and link to the location expected by .cargo/config.toml.
78- # # Python + requirements are needed to compile the OS.
79- # - uses: actions/setup-python@v5
80- # id: setup-pypy
81- # with:
82- # python-version: "pypy3.9"
83- # cache: "pip"
84- # - run: ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
85- # - env:
86- # LD_LIBRARY_PATH: ${{ env.Python3_ROOT_DIR }}/bin
87- # run: echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
88- # - run: pip install -r scripts/requirements.txt
89-
90- # - uses: ./.github/actions/bootstrap
91- # with:
92- # github_token: ${{ secrets.GITHUB_TOKEN }}
93-
94- # # Auth with GCS for bench_tools to download inputs.
95- # - id: auth
96- # uses: "google-github-actions/auth@v2"
97- # with:
98- # credentials_json: ${{ secrets.COMMITER_PRODUCTS_EXT_WRITER_JSON }}
99- # - uses: "google-github-actions/setup-gcloud@v2"
100-
101- # # Benchmark the base branch code.
102- # - run: cargo run -p bench_tools -- run --package starknet_committer_and_os_cli --out /tmp/base_results
103-
104- # # Save the input files from the base branch to use in the second benchmark.
105- # - run: cp -r crates/starknet_committer_and_os_cli/test_inputs /tmp/test_inputs
106-
107- # # Checkout the current branch to benchmark the new code.
108- # - uses: actions/checkout@v4
109- # with:
110- # clean: false
111-
112- # # Re-install pip requirements in case they changed between branches.
113- # - run: pip install -r scripts/requirements.txt
114-
115- # # Benchmark the current branch and compare to the previous run.
116- # # Use the saved inputs and enforce absolute time limits (full_committer_flow: 25ms, tree_computation_flow: 20ms).
117- # - run: |
118- # cargo run -p bench_tools -- run-and-compare \
119- # --package starknet_committer_and_os_cli \
120- # --out /tmp/new_results \
121- # --regression-limit 8.0 \
122- # --input-dir /tmp/test_inputs \
123- # --set-absolute-time-ns-limit full_committer_flow ${FULL_COMMITTER_FLOW_TIME_LIMIT_NS} \
124- # --set-absolute-time-ns-limit tree_computation_flow ${TREE_COMPUTATION_FLOW_TIME_LIMIT_NS}
67+ benchmarking :
68+ runs-on : namespace-profile-medium-ubuntu-24-04-amd64
69+ if : ${{ github.event_name == 'pull_request' }}
70+ steps :
71+ # Checkout the base branch to benchmark the old code.
72+ - uses : actions/checkout@v4
73+ with :
74+ ref : ${{ github.base_ref }}
75+
76+ # Setup pypy and link to the location expected by .cargo/config.toml.
77+ # Python + requirements are needed to compile the OS.
78+ - uses : actions/setup-python@v5
79+ id : setup-pypy
80+ with :
81+ python-version : " pypy3.9"
82+ cache : " pip"
83+ - run : ln -s '${{ steps.setup-pypy.outputs.python-path }}' /usr/local/bin/pypy3.9
84+ - env :
85+ LD_LIBRARY_PATH : ${{ env.Python3_ROOT_DIR }}/bin
86+ run : echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> $GITHUB_ENV
87+ - run : pip install -r scripts/requirements.txt
88+
89+ - uses : ./.github/actions/bootstrap
90+ with :
91+ github_token : ${{ secrets.GITHUB_TOKEN }}
92+
93+ # Auth with GCS for bench_tools to download inputs.
94+ - id : auth
95+ uses : " google-github-actions/auth@v2"
96+ with :
97+ credentials_json : ${{ secrets.COMMITER_PRODUCTS_EXT_WRITER_JSON }}
98+ - uses : " google-github-actions/setup-gcloud@v2"
99+
100+ # Benchmark the base branch code.
101+ - run : cargo run -p bench_tools -- run --package starknet_committer_and_os_cli --out /tmp/base_results
102+
103+ # Save the input files from the base branch to use in the second benchmark.
104+ - run : cp -r crates/starknet_committer_and_os_cli/test_inputs /tmp/test_inputs
105+
106+ # Checkout the current branch to benchmark the new code.
107+ - uses : actions/checkout@v4
108+ with :
109+ clean : false
110+
111+ # Re-install pip requirements in case they changed between branches.
112+ - run : pip install -r scripts/requirements.txt
113+
114+ # Benchmark the current branch and compare to the previous run.
115+ # Use the saved inputs and enforce absolute time limits (full_committer_flow: 25ms, tree_computation_flow: 20ms).
116+ - run : |
117+ cargo run -p bench_tools -- run-and-compare \
118+ --package starknet_committer_and_os_cli \
119+ --out /tmp/new_results \
120+ --regression-limit 8.0 \
121+ --input-dir /tmp/test_inputs \
122+ --set-absolute-time-ns-limit full_committer_flow ${FULL_COMMITTER_FLOW_TIME_LIMIT_NS} \
123+ --set-absolute-time-ns-limit tree_computation_flow ${TREE_COMPUTATION_FLOW_TIME_LIMIT_NS}
0 commit comments