Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: lock-free cycle count increment #1169

Merged
merged 2 commits into from
Jan 4, 2025
Merged

Conversation

jonathanpwang
Copy link
Contributor

A stupid but important performance optimization when metric collection is turned on: every instruction increments the cycle count. When this is done directly via metric::Counter the metric recorder acquires a lock every time. This has significant (2x) performance impact on execution.

@jonathanpwang jonathanpwang added the run-benchmark triggers benchmark workflows on the pr label Jan 4, 2025
Copy link

github-actions bot commented Jan 4, 2025

group app.proof_time_ms app.cycles app.cells_used leaf.proof_time_ms leaf.cycles leaf.cells_used
verify_fibair (-105 [-6.5%]) 1,503 194,752 8,012,822 - - -
fibonacci_program (-858 [-11.6%]) 6,556 1,500,137 51,505,102 (-1830 [-10.2%]) 16,194 3,171,679 128,849,226
regex_program (-2749 [-12.3%]) 19,623 4,190,904 165,028,173 (-4083 [-11.5%]) 31,546 6,523,215 291,291,355
ecrecover_program (-190 [-6.5%]) 2,732 290,016 15,230,037 (-6759 [-13.9%]) 41,976 9,778,270 445,631,858

Commit: 2bbc8fc

Benchmark Workflow

@jonathanpwang jonathanpwang merged commit 3735d97 into main Jan 4, 2025
16 checks passed
@jonathanpwang jonathanpwang deleted the perf/bench-metric-execute branch January 4, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-benchmark triggers benchmark workflows on the pr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant