Skip to content

Tweak default RTS options#1047

Merged
blishko merged 2 commits intomainfrom
perf-a-n
Mar 9, 2026
Merged

Tweak default RTS options#1047
blishko merged 2 commits intomainfrom
perf-a-n

Conversation

@elopez
Copy link
Collaborator

@elopez elopez commented Mar 9, 2026

Description

This tweaks -A4m -> -A32m; see https://downloads.haskell.org/ghc/latest/docs/users_guide/runtime_control.html#rts-flag-A-size

bench-perf shows 60%+ improvements across tests due to less time spent in GC. I haven't tested symbolic execution through hevm CLI but it's likely to benefit too.

For comparison, we ship -A64m as default in echidna but even higher values like -A1g show improvement for very large machines.

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

@msooseth
Copy link
Collaborator

msooseth commented Mar 9, 2026

I'm not against this. In general, symbolic execution speed is mostly governed by SMT solver speed. So I'd say this is OK from my side. @blishko ?

Copy link
Collaborator

@msooseth msooseth left a comment

Choose a reason for hiding this comment

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

LGTM, but let's wait for Martin!

@blishko
Copy link
Collaborator

blishko commented Mar 9, 2026

Seems OK to me.
I trust @elopez expertise here; I don't plan to delve into GHC internals :)

@blishko
Copy link
Collaborator

blishko commented Mar 9, 2026

I would like to run bench-perf on my machine, just to confirm.
Let's merge #1044 first and then this one.

@blishko
Copy link
Collaborator

blishko commented Mar 9, 2026

@elopez, can you rebase this one?
Let's focus on this one now.

elopez added 2 commits March 9, 2026 11:12
hevm's execution model allocates heavily in the GC nursery (gen0) due
to immutable record reconstruction on every EVM step. All allocations
are short-lived and never survive to gen1. The default 4MB nursery
causes excessive minor GC pauses.

Setting -A32m reduces GC frequency dramatically, yielding significant
speedups across all benchmarks.
EVM execution is single-threaded. With -N (auto-detect), GHC creates one
capability per core, each with a 32MB nursery. The extra capabilities add
GC synchronization overhead without benefit since only one is used.

Also adds -rtsopts so RTS parameters can be overridden at runtime.
Copy link
Collaborator

@blishko blishko left a comment

Choose a reason for hiding this comment

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

Should be OK!

@blishko blishko merged commit 2baa264 into main Mar 9, 2026
8 of 9 checks passed
@blishko blishko deleted the perf-a-n branch March 9, 2026 21:24
@msooseth
Copy link
Collaborator

@elopez do you know why Echidna with local hevm is failing?

@elopez
Copy link
Collaborator Author

elopez commented Mar 10, 2026

@msooseth it's expected; Echidna does not build with current hevm main. It should resolve itself once we update hevm in Echidna (likely via crytic/echidna#1499)

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.

3 participants