DOI: 10.3390/sym18091559 ISSN: 2073-8994

Computational Performance of Programming Languages in Mathematical Biology: A Ten-Language Evaluation Across Six Modeling Regimes

Yi Zheng, Qiuming Luo

Mathematical biology spans multiple computational regimes—from ordinary differential equation models of gene regulatory networks to stochastic simulation of chemical kinetics and reaction-diffusion models of spatial pattern formation—each imposing distinct computational demands on the software infrastructure that executes them. The choice of programming language for implementation of these mathematical models carries quantitative performance consequences that have not been systematically measured across the range of models employed in contemporary mathematical biology. This study provides a computational performance evaluation across ten languages (Python, Julia, Rust, C, C++, C#, F#, Go, Java, and R) and six mathematical biology modeling regimes: deterministic ODE integration, stochastic chemical kinetics, parameter-space exploration, reaction-diffusion spatial modeling, agent-based discrete simulation, and Bayesian parameter inference. Execution time, peak memory footprint, cyclomatic complexity, type-conversion density, and the semantic alignment between data structures and biological state representation were recorded under a uniform experimental protocol. Under a unified hand-coded Dormand–Prince 5(4) integrator, native implementations outperform managed-runtime counterparts by nearly two orders of magnitude for ODE integration, a differential that shrinks sharply once library-delegated solvers are removed from the comparison; the gap contracts below 55× when stochastic kinetics shift the bottleneck from arithmetic throughput to branch resolution. In memory-bandwidth-limited reaction-diffusion modeling, native and just-in-time implementations converge to within a few percent. Agent-based models expose a distinct regime-dependent overhead: immutable-by-default collection semantics impose disproportionate cost during mutation-intensive computation. Peak memory varies by roughly two orders of magnitude across languages, directly affecting deployment density for large-scale simulation. Code-structural measurements confirm that algorithmic form enforces a floor on cyclomatic complexity, irrespective of language, while type strictness and mutation semantics generate substantial differences in per-line cognitive load. These results provide a quantitative foundation for computational tool selection in mathematical biology, challenging universal language recommendations and supporting choices grounded in the algorithmic character of each modeling regime.