Use all best practice to squeeze a few more TPS out of Prover (#38)

This commit is contained in:
Vinh Trịnh
2025-09-23 18:18:52 +07:00
committed by GitHub
parent 3a56b92515
commit ab032ec74b
3 changed files with 24 additions and 4 deletions

View File

@@ -42,3 +42,12 @@ tonic-prost-build = "0.14.1"
#[dev.dependencies]
criterion = { version = "0.7.0", features = ["async_tokio"] }
[profile.release]
lto = "fat"
codegen-units = 1
opt-level = 3
debug = false
panic = "abort"
strip = true
incremental = false

15
Makefile Normal file
View File

@@ -0,0 +1,15 @@
NATIVE_FLAGS = -C target-cpu=native
.PHONY: build
build:
cargo build --release $(ARGS)
RAYON_NUM_THREADS ?= 64
PROOF_SERVICE_COUNT ?= 64
PROOF_COUNT ?= 64
.PHONY: bench
bench:
RAYON_NUM_THREADS=$(RAYON_NUM_THREADS) PROOF_SERVICE_COUNT=$(PROOF_SERVICE_COUNT) PROOF_COUNT=$(PROOF_COUNT) RUSTFLAGS="$(NATIVE_FLAGS)" cargo bench $(ARGS)
# Example: make bench RAYON_NUM_THREADS=128 PROOF_SERVICE_COUNT=32 PROOF_COUNT=8 ARGS="--bench prover_bench"

View File

@@ -24,7 +24,3 @@ opentelemetry-otlp = { version = "0.30.0", features = [
"tls-roots",
] }
tracing-opentelemetry = "0.31.0"
[profile.release]
codegen-units = 1 # Do not split into multiple codegen units, improve performance, may compile slower
lto = "fat" # Enables Link Time Optimization, enabling more aggressive optimizations across the entire codebase