Skip to content

feat: add bench_ssz step#318

Open
spiral-ladder wants to merge 1 commit intomainfrom
bing/bench-ssz-step
Open

feat: add bench_ssz step#318
spiral-ladder wants to merge 1 commit intomainfrom
bing/bench-ssz-step

Conversation

@spiral-ladder
Copy link
Copy Markdown
Collaborator

While reviewing #291 I found it slightly inconvenient to run each bench_ssz_* step. This PR allows the user to run all the ssz benchmarks at once.

While reviewing #291 I found
it slightly inconvenient to run each bench_ssz_* step. This PR allows
the user to run all the ssz benchmarks at once.
@spiral-ladder spiral-ladder self-assigned this Apr 17, 2026
@spiral-ladder spiral-ladder requested a review from a team as a code owner April 17, 2026 10:29
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request simplifies the benchmarking workflow by introducing a consolidated build step. By aggregating multiple individual SSZ benchmark tasks into a single command, it improves developer efficiency and reduces the manual effort required to run performance tests.

Highlights

  • New Build Step: Added a new 'run:bench_ssz' build step to the Zig build system to execute all SSZ benchmarks in a single command.
  • Configuration Update: Updated the project configuration to include the 'bench_ssz' run command for easier access.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new run:bench_ssz step to execute multiple SSZ benchmarks simultaneously. The feedback highlights that using addSystemCommand to invoke zig build recursively is an anti-pattern in Zig build scripts, as it bypasses the build graph's dependency management and parallel execution capabilities. Instead, the step should directly depend on the individual benchmark steps. Additionally, a line length violation of the 100-column limit was identified, and a more descriptive, non-redundant step description was suggested.

Comment thread build.zig
Comment on lines +1032 to +1034
const run_bench_ssz = b.addSystemCommand(&.{ "zig", "build", "run:bench_ssz_attestation", "run:bench_ssz_block", "run:bench_ssz_state" });
const tls_run_bench_ssz = b.step("run:bench_ssz", "Run the bench_ssz run");
tls_run_bench_ssz.dependOn(&run_bench_ssz.step);
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.

medium

Calling zig build via addSystemCommand is an anti-pattern in Zig build scripts. It spawns a sub-process, which is inefficient and breaks the build graph's ability to manage dependencies and parallel execution. Since the individual benchmark steps are already defined in this file, the run:bench_ssz step should directly depend on them.

Additionally, line 1032 exceeds the 100-column limit (Style Guide Repo line 400), and the description "Run the bench_ssz run" is redundant.

Note: As this file is marked as generated, you should ensure that the tool zbuild or its configuration in zbuild.zon is updated to produce the correct dependency-based logic instead of a shell command.

    const tls_run_bench_ssz = b.step("run:bench_ssz", "Run all SSZ benchmarks");
    tls_run_bench_ssz.dependOn(&run_exe_bench_ssz_attestation.step);
    tls_run_bench_ssz.dependOn(&run_exe_bench_ssz_block.step);
    tls_run_bench_ssz.dependOn(&run_exe_bench_ssz_state.step);
References
  1. Hard limit all line lengths, without exception, to at most 100 columns. (link)

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