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).
| Network | Nodes | Links | Steps | Time (best of 5) |
|---|---|---|---|---|
| NY Tunnels | 20 | 42 | 120 | 4.7 ms |
| D-Town | 407 | 459 | 673 | 70 ms |
| Balerma | 447 | 454 | 1 | 3.9 ms |
| L-Town | 785 | 909 | 2,017 | 109 ms |
| Richmond | 872 | 957 | 25 | 15 ms |
| KY10 | 935 | 1,061 | 1 | 6.1 ms |
| KY9 | 1,261 | 1,343 | 1 | 8.9 ms |
| KY8 | 1,332 | 1,618 | 1 | 6.5 ms |
| Micropolis | 1,577 | 1,619 | 241 | 519 ms |
| Exnet | 1,893 | 2,467 | 1 | 6.6 ms |
| BWSN2 | 12,527 | 14,831 | 49 | 168 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