BAM Engine 0.10.0 measures itself against the wider agent-based modelling ecosystem. A new benchmark suite runs the identical baseline BAM model on five frameworks, and a round of performance work makes BAM Engine the fastest of the group at scale. There are no breaking changes to the public API.
Benchmarked Against the Ecosystem#
The same baseline BAM model now runs on five frameworks: BAM Engine, Mesa, mesa-frames (Polars), Agents.jl (Julia), and NetLogo. A new benchmark harness runs each of them across a common range of population sizes and compares runtime and peak memory.
The comparison measures the same model, not five different ones. Before any framework’s timings are counted, its port must clear a behavioural-equivalence gate: twenty seeds checked against the BAM Engine reference on GDP and unemployment autocorrelation, inflation dynamics, firm-size distribution, and cross-correlation structure. NetLogo is included as a non-blocking cross-language reference, reproducing the baseline levels while diverging on some higher-order co-movement structure.
Because the results snapshots and per-run environment captures are committed alongside the harness, the numbers are auditable without re-running the whole matrix.
Faster at Scale#
Firm selection in the labour, credit, and goods markets used to build a dense
priority matrix. It now uses a sparse O(N*k) sampler that draws only the
firms each agent actually considers. Matching is roughly 8.8x faster at 1000
firms and scales to 20000 firms, with validation scores unchanged. The
goods-market sequential loop and the firing pass were micro-optimized in the
same pass, bit-identical to before and about 20 to 28 percent faster at scale.
Optional Numba Kernel#
Installing the fast extra enables an optional Numba JIT kernel for the goods
market:
pip install bamengine[fast]It is opt-in through a new goods_kernel configuration parameter ("auto",
"numba", or "python"), produces bit-identical results to the pure-Python
path, and delivers roughly a 2x speedup at scale. Together with the matching
work, this is what puts BAM Engine ahead of the other frameworks at large
populations.
See the release history for full details.
Upgrading#
pip install --upgrade bamengine