This page is for readers who want to know what zupmxode costs before they use it: how its compile and solve times compare with rxode2 and mrgsolve on the same machine, and where it runs native code or MIR’s interpreter.
Benchmarks
tools/run-benchmarks in the source repository times each
workload of the package’s design (§10) for every engine installed, and
keeps every run in .agents/benchmarks.csv. The table shows
the latest measured run of each row. “zupmxode/lsoda” is zupmxode made
to use LSODA, rxode2’s solver, where it would choose the matrix
exponential.
| Workload | Target | zupmxode | zupmxode/lsoda | rxode2 | mrgsolve |
|---|---|---|---|---|---|
| Compile a two-compartment model | under 20 ms | 0.011 | 0.946 | 1.67 | |
| 200 candidate models, compiled and run | faster than rxode2 | 2.59 | 198 | 321 | |
| Closed form, 1e6 subjects | matches rxode2 | 3.71 | 39.8 | 11.1 | |
| Two-compartment ODE, 1e3 x 1e3, 1 thread | within 1.5x of rxode2 | 2.86 | 4.97 | 1.52 | 0.765 |
| The same, interpreter tier | recorded | 3.9 | 8.11 | ||
| Seven-cycle antibody workload, obs/s | above 5,000 | 297,900 | 128,400 | 289,300 | 397,700 |
Times are in seconds, except the last row. They were taken on one Darwin x86_64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz 6 cores, a machine that was not idle; rxode2’s closed-form row is from an earlier day, when it had the memory that row needs. That build of R has no OpenMP, so every row ran on one thread. The two-compartment ODE misses its target (issue #34); the compile and candidate rows, which a model-building loop pays for, are two orders of magnitude ahead.
Tiers
zupmxode runs a model on one of two tiers: native
code generated by MIR, or MIR’s interpreter. Both give the same doubles,
which the test suite checks on every model. The interpreter is the
fallback where native code cannot be made; in the table above it is
about 1.4 times slower with the matrix exponential and 1.6 times with
LSODA. pmx_ode_info() names a model’s tier and
pmx_ode_tier() changes it.
Both tiers run on every leg of the package’s R CMD check, which a test asserts on each of them:
| Leg | Tiers |
|---|---|
| macOS, R-release | native and interpreter |
| Windows, R-release and R-devel | native and interpreter |
| Ubuntu, R-release and R-oldrel | native and interpreter |
| Linux containers, R-devel (clang 23 and the other compilers R CMD check runs on) | native and interpreter |
Both tiers need memory that is writable and executable. Where the
system refuses it (SELinux’s deny_execmem, some hardened
containers), neither runs and models cannot be solved;
zumir::zumir_info() says why. On macOS, R needs the
allow-jit entitlement that CRAN’s build of R has.
Where next
- Get started shows the functions these figures time.
- The reference documents
pmx_ode_threads(), which sets the number of threads where OpenMP is present.