Skip to content

Support Zisk profiling#259

Merged
jsign merged 6 commits intomasterfrom
jsign-zisk-prof
Feb 10, 2026
Merged

Support Zisk profiling#259
jsign merged 6 commits intomasterfrom
jsign-zisk-prof

Conversation

@jsign
Copy link
Collaborator

@jsign jsign commented Feb 10, 2026

This PR adds a feature to dump Zisk profiles when running in execute mode.

If the --zisk-profile flag is added when using --action execute, it will dump ziskemu profiles of all executed fixtures in an output folder (zisk-profiles by default or can be overridden by --zisk-profile-output).

> tree zisk-profiles               
zisk-profiles
└── ethrex-v9.0.0
    ├── zisk_profile_rpc_block_23533518.prof
    ├── zisk_profile_rpc_block_23533705.prof
    ├── zisk_profile_rpc_block_23533763.prof
    ├── zisk_profile_rpc_block_23533796.prof
...

I also added a Python script that can read this output folder and provide some summary about all the fixture runs regarding costs (e.g. avg, min, max, etc.), and also a plot to have an easier visual on this. I'll soon share a HackMD doc with results from 500 mainnet blocks.

const DEFAULT_GUEST_VERSION: &str = "v0.5.0";

/// A zkVM instance bundled with ELF bytes (used for profiling).
pub struct ZkVMInstance {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Before we moved just DockerizedzkVM between the setup and run phase. Now we move ZkVMInstance which also contains the ELF needed if the new flag is activated.

Comment on lines -95 to +96
.iter()
.par_iter()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unrelated improvement: parallelize input generation from fixtures. Helps to save some seconds if we have many fixtures to run.

}

/// Runs Zisk profiling for a single fixture.
pub fn run_profiling(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TL;DR: ziskemu -X -S -D -e with the ELF and raw inputs, saving the output to the desired folder.

cli.action
);
}
if cli.zkvms.len() != 1 || cli.zkvms[0] != zkVMKind::Zisk {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Be a bit strict here to avoid confusions.

@jsign jsign marked this pull request as ready for review February 10, 2026 12:22
@jsign jsign requested a review from han0110 February 10, 2026 12:22
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not super interesting to review.

Copy link
Collaborator

@han0110 han0110 left a comment

Choose a reason for hiding this comment

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

LGTM!

@jsign jsign merged commit 64d9631 into master Feb 10, 2026
1 of 3 checks passed
@jsign jsign deleted the jsign-zisk-prof branch February 10, 2026 14:08
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