Skip to content

perf: add instruction count benchmarks and CI regression gate#203

Open
Julianemeka wants to merge 1 commit into
PrincessnJoy:mainfrom
Julianemeka:feature/issue-99-benchmarks
Open

perf: add instruction count benchmarks and CI regression gate#203
Julianemeka wants to merge 1 commit into
PrincessnJoy:mainfrom
Julianemeka:feature/issue-99-benchmarks

Conversation

@Julianemeka
Copy link
Copy Markdown

Summary

Adds instruction count benchmarks for the three key governance operations and a CI job that fails on regression.

Changes:

  • contracts/governance/src/benchmarks.rs — benchmarks for create_proposal, cast_vote, and finalise using env.budget().instructions_consumed(). Baselines set at 5,000,000 instructions; CI fails if any operation exceeds baseline by more than 10%.
  • .github/workflows/ci.yml — new benchmark job runs cargo test bench_ on every push/PR to main/develop. Build job now depends on benchmark passing.
  • docs/performance.md — updated with baseline table, CI limit column, scaling analysis, and methodology.

Closes #99

- Rewrite benchmarks.rs with create_proposal, cast_vote, finalise benchmarks
- Store baselines (5M instructions) with 10% regression threshold
- Add benchmark CI job that fails on regression
- Update docs/performance.md with budget table and methodology

Closes PrincessnJoy#99
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@Julianemeka Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

No performance benchmarking in CI for contract instruction counts

1 participant