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

Run all benchmarks in make bench and CI #292

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ fmt: ## Format the code

.PHONY: bench
bench: ## Run benchmarks
cargo bench --features "$(FEATURES)" --bench bench_main
# cargo bench --bench bench_main -- --verbose
cargo bench --features "$(FEATURES)" --workspace

.PHONY: bench-report-open
bench-report-open: ## Open last benchmark report in the browser
Expand Down
1 change: 0 additions & 1 deletion crates/rbuilder/src/building/built_block_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ impl BuiltBlockTrace {
/// Should be called after block is sealed
/// Sets:
/// orders_sealed_at to the current time
/// orders_closed_at to the given time
pub fn update_orders_sealed_at(&mut self) {
self.orders_sealed_at = OffsetDateTime::now_utc();
}
Expand Down
6 changes: 3 additions & 3 deletions scripts/ci/benchmark-in-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ function run_benchmark() {
if [ "$HEAD_SHA" == "$BASE_SHA" ]; then
# Benchmark only current commit, no comparison
echo "Running cargo bench ..."
cargo bench --bench bench_main
cargo bench --workspace
else
# Benchmark target commit first, and then benchmark current commit against that baseline
echo "Benchmarking ${HEAD_SHA_SHORT} against the target ${BASE_SHA_SHORT} ..."

# Switch to target commit and run benchmarks
echo "Switching to $BASE_SHA_SHORT and starting benchmarks ..."
git checkout $BASE_SHA
cargo bench --bench bench_main
cargo bench --workspace

# Switch back to current commit and run benchmarks again
echo "Switching back to $HEAD_SHA_SHORT and running benchmarks ..."
git checkout $HEAD_SHA
cargo bench --bench bench_main
cargo bench --workspace
fi
}

Expand Down
Loading