Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Performance

Hydra is fast enough to run large extended-period simulations interactively. The figures below are indicative — they show the order of magnitude you can expect, not a controlled lab result. Your own hardware, build flags, and network characteristics will change the numbers.

End-to-end timings

Each figure is the best of 5 runs (after a warm-up) of the full command-line workflow on one network: parse the .inp, run the complete extended-period simulation, and produce the summary report. Networks are the ones bundled in tests/benchmarks/.

Measured on an Apple M5 Pro (macOS 26.5), release build (cargo build --release, fat LTO, codegen-units = 1).

NetworkNodesLinksStepsTime (best of 5)
NY Tunnels20421204.7 ms
D-Town40745967370 ms
Balerma44745413.9 ms
L-Town7859092,017109 ms
Richmond8729572515 ms
KY109351,06116.1 ms
KY91,2611,34318.9 ms
KY81,3321,61816.5 ms
Micropolis1,5771,619241519 ms
Exnet1,8932,46716.6 ms
BWSN212,52714,83149168 ms

Steps is the number of reporting periods. Single-period (Steps: 1) rows are steady-state snapshots — their times are dominated by process start-up and parsing rather than the solve, so treat any sub-10 ms figure as “effectively instant.” The larger the network, the more of each hydraulic step is spent in the sparse linear solve; networks with heavy control/rule logic or water-quality transport (Micropolis, for example) cost more per step than their node count alone suggests.

Reproducing these numbers

The table is generated by a committed harness, so it can be regenerated rather than going stale:

just bench-report

This builds the release CLI and runs scripts/benchmark.py, which times each network and prints the Markdown table above. Pass --runs N to change the sample count, or --hydra PATH to benchmark a specific binary.

Building for maximum speed

The release profile already enables fat LTO and a single codegen unit. For the best local performance, build with native CPU features:

just release-native

This tunes the binary for the machine it is built on (-C target-cpu=native); such binaries are not portable to older CPUs.

Solver micro-benchmarks

For work on the solver itself, the criterion suite times the hydraulic solve step (warm and cold) in isolation:

just bench