Generated: 2026-11-25 10:18:21 UTC
R analog of the Python benchmark report (published by the same nightly run) — the first three tables share its table shape and three-color row coding; the inference-procedure and design-generation tables are R-only.
Selected sections: models, wald, utility, procedures, designs
Every part below was timed at commit 912c61aab26c.
912c61aab26c (2026-11-25 09:11 UTC)912c61aab26c (2026-11-25 09:17 UTC)912c61aab26c (2026-11-25 09:17 UTC)912c61aab26c (2026-11-25 09:08 UTC)912c61aab26c (2026-11-25 09:15 UTC)912c61aab26c (2026-11-25 09:19 UTC)912c61aab26c (2026-11-25 09:20 UTC)912c61aab26c (2026-11-25 09:18 UTC)912c61aab26c (2026-11-25 09:30 UTC)912c61aab26c (2026-11-25 09:27 UTC)912c61aab26c (2026-11-25 09:41 UTC)912c61aab26c (2026-11-25 09:46 UTC)912c61aab26c (2026-11-25 09:55 UTC)912c61aab26c (2026-11-25 09:51 UTC)912c61aab26c (2026-11-25 09:45 UTC)This report compares the performance of EDI's Rcpp-optimized model fitting paths against low-level canonical R implementations (e.g., glm.fit, lm.fit, coxph.fit) where possible.
These rows are read from build metadata compiled into the loaded EDI shared object via edi_build_info_cpp().
Compilation warning: EDI model-fit timings are sensitive to the compiler flags used to build the loaded EDI.so. If EDI is compiled without the proper optimized flags, or with flags that are known to degrade these kernels such as problematic LTO builds, the benchmark can show substantial performance regressions that reflect the binary build rather than the modeling algorithms.
Default install vs. this build: every standard install of EDI (CRAN, R-universe, or GitHub source) uses the portable build (EDI_PORTABLE=1, no -march=native/-mtune=native or -O3 override), so results match across platforms. The timings below come from the build listed in this section; when it shows EDI_PORTABLE=0, they are from the opt-in tuned build described in the README's "Tuning Local Builds" section, and a default install may run slower. When it shows EDI_PORTABLE=1 but the R CXX20FLAGS listed here include -O3 or -march=native, R itself was built with those flags and EDI compiles with them, so these timings can also beat a default install (see the README's "Tuning Local Builds" section, which covers rebuilding R).
/home/runner/work/EDI/EDI/bench-libs/head/EDI/libs/EDI.so2026-11-25 08:53:38/home/runner/work/EDI/EDI/bench-libs/head/EDI3738f271ad94bc05eaff75dcdf8b742a3bd41a6bd4c32f6cee32960c199c1dfc2configure-generated header compiled into EDI.so2026-11-25 08:48:57 UTCrunnervm0hi8gR version 4.6.2 (2026-10-29) -- "Diversified Portfolio"CXX20 at build: g++CXX20STD at build: -std=gnu++20CXX20FLAGS at build: -g -O2SHLIB_OPENMP_CXXFLAGS at build: -fopenmpEDI_PORTABLE=1, EDI_DISABLE_VECTORIZATION=0, EDI_NATIVE_SPEED=1, EDI_NATIVE_LTO=0PKG_CPPFLAGS at build: ``PKG_CXXFLAGS at build: $(SHLIB_OPENMP_CXXFLAGS) -DNDEBUG -DEIGEN_NO_DEBUGPKG_LIBS at build: $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) -fstack-protector15.2.0TRUEFALSEFALSEAll benchmarks were performed on a synthetic clinical-trial-scale dataset generated for each response type. The data generation process ensures numerical stability and fair solver comparison by using the following parameters:
iBCRD, and 4 continuous covariates ($X \sim \text{Normal}(0, 1)$).iBCRD design.InferenceSurvivalStratCoxPHRegr, the benchmark injects low-cardinality covariates before outcome generation so the row exercises a genuinely stratified Cox fit rather than the unstratified fallback.fast_logistic_regression_cpp, fast_ordinal_regression_cpp) with all design matrices and fixed inputs pre-built outside the timed region. There is no R6 object instantiation, no cached state management, no warm start storage, and no standard error computation in the timed region — only the raw numerical solver.glm.fit, lm.fit, coxph.fit) with pre-built design matrices. If a canonical package exposes no low-level function, the formula-based API is used instead.system.time; paths below 0.01 ms use microbenchmark(times = 5000) instead.Timing Pval reports a Welch two-sample t-test comparing the EDI and canonical timing replicate distributions for each row. The unlabeled final column marks thresholds with *** for p < 0.001, ** for p < 0.01, and * for p < 0.05.Speedup > 1 and Timing Pval < 0.05; light red rows indicate significant Speedup < 1; light grey rows indicate NA timing comparisons from a failed fit; light blue rows are estimators with no canonical R implementation at all (only EDI is timed, Canonical Time/Speedup/Timing Pval are NA by design).package_metadata/python_bindings_package_spec.md for the baseline-gap analysis), while the matched-pair random-intercept GLMM family, Weibull lognormal frailty, zero-one-inflated beta and interval-censored Weibull AFT rows carry real canonical comparators since 2026-10-07 (lme4/glmmTMB/ordinal::clmm, parfm, gamlss(BEINF), survreg(interval2)/icenReg::ic_par). lme4::glmer(nAGQ = 20) and ordinal::clmm(nAGQ = 20) match EDI's 20-node Gauss-Hermite marginal likelihood; glmmTMB is Laplace-only; lmer uses ML (REML = FALSE) like EDI. parfm fits the proportional-hazards parameterization of the same Weibull lognormal-frailty model (equivalent to EDI's AFT-scale Normal random intercept up to reparameterization) and takes ~25 s per fit, so its rows use 5 timing replicates. zoib (Bayesian MCMC) is deliberately not timed against EDI's ML fit.InferenceContinRobustRegr vs MASS::rlm and robustbase::lmrob.fit; the GLMM rows vs lme4 and glmmTMB); such rows share one dataset and re-time the same EDI kernel.[1, treatment, covariates] (with intercept) to fast_weibull_regression_general_cpp, the layout InferenceSurvivalWeibullRegr builds internally, under which the kernel reproduces survreg()'s coefficients and log-likelihood exactly. Reports generated before 2026-10-07 omitted the intercept on the EDI side of that row.EDI faster, significant EDI slower, significant NA timing comparison no canonical R implementation
| Class | Response | EDI Time (ms) | Canonical Pkg | Canonical Func | Canonical Time (ms) | Speedup | Timing Pval | EDI Iterations | Canonical Iterations | |
|---|---|---|---|---|---|---|---|---|---|---|
| InferenceAllSimpleWilcox | continuous | 0.08 | stats | HL median pairwise diff | 1.19 | 15.76x | 1.65e-19 | *** | NA | NA |
| InferenceContinGLMM (pairs) | continuous | 0.26 | lme4 | lmer(ML) | 15.58 | 60.49x | 1.84e-60 | *** | 9 | NA |
| InferenceContinGLMM (pairs) | continuous | 0.26 | glmmTMB | glmmTMB(gaussian) | 105.00 | 405.46x | 9.34e-58 | *** | 9 | NA |
| InferenceContinOLS | continuous | 0.01 | stats | lm.fit | 0.09 | 6.89x | 4.46e-21 | *** | NA | NA |
| InferenceContinQuantileRegr | continuous | 1.08 | quantreg | rq.fit | 1.08 | 1x | 0.351 | NA | NA | |
| InferenceContinRobustRegr | continuous | 0.11 | MASS | rlm(MM) | 45.70 | 430.85x | 1.85e-59 | *** | 8 | NA |
| InferenceContinRobustRegr | continuous | 0.11 | robustbase | lmrob.fit(MM) | 49.00 | 464.36x | 3.86e-57 | *** | 8 | 9 |
| InferenceIncidBinomialIdentityRiskDiff | incidence | 0.13 | stats | glm.fit(ident) | 0.81 | 6.01x | 4.06e-18 | *** | 5 | 4 |
| InferenceIncidGCompRiskDiff | incidence | 0.07 | stats | glm.fit+gcomp(RD) | 0.90 | 12.99x | 4.28e-15 | *** | NA | NA |
| InferenceIncidGCompRiskRatio | incidence | 0.08 | stats | glm.fit+gcomp(RR) | 0.96 | 11.98x | 1.17e-14 | *** | NA | NA |
| InferenceIncidKKCondLogitGLMMOneLik | incidence | 12.18 | None | no canonical R implementation | NA | NA | NA | 7 | NA | |
| InferenceIncidLogBinomial | incidence | 0.20 | stats | glm.fit(log) | 1.18 | 5.79x | 4e-20 | *** | 7 | 4 |
| InferenceIncidLogRegr | incidence | 0.06 | stats | glm.fit | 0.92 | 14.51x | 1.9e-15 | *** | 5 | 4 |
| InferenceIncidModifiedPoisson | incidence | 0.06 | stats | glm.fit(modified) | 1.16 | 18.95x | 1.5e-19 | *** | 5 | 5 |
| InferenceIncidProbitRegr | incidence | 0.17 | stats | glm.fit(probit) | 1.13 | 6.82x | 1.11e-19 | *** | 7 | 4 |
| InferenceIncidRiskDiff | incidence | 8.35e-03 | stats | lm.fit(LPM) | 0.06 | 6.85x | 3.9e-20 | *** | NA | NA |
| fast_logistic_glmm_cpp (pairs, kernel only) | incidence | 31.43 | lme4 | glmer(binomial, nAGQ=20) | 218.00 | 6.94x | 7.92e-70 | *** | 9 | NA |
| fast_logistic_glmm_cpp (pairs, kernel only) | incidence | 30.43 | glmmTMB | glmmTMB(binomial) | 97.33 | 3.2x | 3.24e-74 | *** | 9 | NA |
| InferenceCountGLMM (pairs) | count | 57.25 | lme4 | glmer(poisson, nAGQ=20) | 326.50 | 5.7x | 3.68e-41 | *** | 21 | NA |
| InferenceCountGLMM (pairs) | count | 58.25 | glmmTMB | glmmTMB(poisson) | 114.00 | 1.96x | 2.83e-82 | *** | 21 | NA |
| InferenceCountHurdleNegBin | count | 1.28 | pscl | hurdle(nb) | 39.58 | 30.9x | 2.2e-27 | *** | 21 | NA |
| InferenceCountHurdlePoisson | count | 2.52 | pscl | hurdle | 23.10 | 9.16x | 3.17e-23 | *** | 65 | NA |
| InferenceCountHurdlePoisson (pairs) | count | 2.12 | glmmTMB | glmmTMB(truncated_poisson, zi RE) | 390.00 | 184.33x | 1.45e-68 | *** | 20 | NA |
| InferenceCountKKCondPoissonOneLik | count | 0.05 | None | no canonical R implementation | NA | NA | NA | 5 | NA | |
| InferenceCountNegBin | count | 0.49 | MASS | glm.nb | 12.15 | 24.98x | 1.04e-58 | *** | 25 | 1 |
| InferenceCountPoisson | count | 0.09 | stats | glm.fit | 1.76 | 20.2x | 5.13e-22 | *** | 6 | 5 |
| InferenceCountQuasiPoisson | count | 0.11 | stats | glm.fit(quasi) | 1.57 | 14.09x | 8.07e-23 | *** | 7 | 5 |
| InferenceCountRobustPoisson | count | 0.10 | stats | glm.fit | 1.69 | 16.27x | 1.16e-26 | *** | 6 | 5 |
| InferenceCountZeroInflatedNegBin | count | 30.00 | pscl | zeroinfl(nb) | 242.00 | 8.07x | 1.71e-26 | *** | 125 | 227 |
| InferenceCountZeroInflatedPoisson | count | 3.63 | pscl | zeroinfl | 165.50 | 45.6x | 1.6e-27 | *** | 79 | 184 |
| InferencePropBetaRegr | proportion | 0.98 | betareg | betareg.fit | 26.33 | 26.73x | 2.86e-26 | *** | 7 | 14 |
| InferencePropFractionalLogit | proportion | 0.11 | stats | glm.fit(quasi) | 1.16 | 10.9x | 9.68e-22 | *** | 5 | 4 |
| InferencePropGCompMeanDiff | proportion | 0.13 | stats | glm.fit(quasi)+gcomp | 1.18 | 8.89x | 7.48e-14 | *** | NA | NA |
| InferencePropZeroOneInflatedBetaRegr | proportion | 2.05 | gamlss | gamlss(BEINF) | 71.67 | 34.91x | 1.61e-25 | *** | 23 | 4 |
| InferenceSurvivalCoxPHRegr | survival | 0.20 | survival | coxph.fit(breslow) | 0.48 | 2.35x | 1.68e-39 | *** | 4 | 4 |
| InferenceSurvivalGLMMWeibullFrailtyNormalOneLik | survival | 3.54 | parfm | parfm(weibull, lognormal) | 17759.00 | 5020.87x | 1.25e-09 | *** | 7 | NA |
| InferenceSurvivalKMDiff | survival | 0.01 | survival | survfit(median) | 3.39 | 270.86x | 6.14e-24 | *** | NA | NA |
| InferenceSurvivalLogRank | survival | 0.03 | survival | survdiff | 1.75 | 65.9x | 3.18e-23 | *** | NA | NA |
| InferenceSurvivalRestrictedMeanDiff | survival | 0.01 | survival | survfit(rmean) | 2.49 | 171.45x | 1.99e-48 | *** | NA | NA |
| InferenceSurvivalStratCoxPHRegr | survival | 0.48 | survival | coxph.fit(strat) | 0.65 | 1.35x | 2.54e-66 | *** | 4 | 3 |
| InferenceSurvivalWeibullRegr | survival | 0.18 | survival | survreg | 3.24 | 17.8x | 2.83e-54 | *** | 10 | 6 |
| InferenceSurvivalWeibullRegr (interval-censored) | survival | 0.42 | survival | survreg(interval2) | 3.76 | 8.97x | 3.63e-21 | *** | 9 | 5 |
| InferenceSurvivalWeibullRegr (interval-censored) | survival | 0.42 | icenReg | ic_par(aft, weibull) | 14.13 | 33.71x | 1.47e-57 | *** | 9 | NA |
| InferenceOrdinalAdjCatLogitRegr | ordinal | 0.64 | VGAM | vglm(acat) | 13.13 | 20.66x | 8.3e-51 | *** | 10 | 5 |
| InferenceOrdinalCLMM (pairs) | ordinal | 247.00 | ordinal | clmm(nAGQ=20) | 650.00 | 2.63x | 1.33e-73 | *** | 58 | NA |
| InferenceOrdinalCauchitRegr | ordinal | 0.54 | ordinal | clm(cauchit) | 7.60 | 13.95x | 2.81e-22 | *** | 10 | 7 |
| InferenceOrdinalCloglogRegr | ordinal | 0.50 | ordinal | clm(cloglog) | 6.59 | 13.04x | 4.17e-53 | *** | 8 | 5 |
| InferenceOrdinalContRatioRegr | ordinal | 0.19 | VGAM | vglm(cratio) | 12.00 | 62.21x | 4.46e-51 | *** | 9 | 5 |
| InferenceOrdinalGCompMeanDiff | ordinal | 0.56 | ordinal | clm+gcomp | 11.56 | 20.78x | 3.81e-48 | *** | NA | NA |
| InferenceOrdinalGLMM (pairs) | ordinal | 212.00 | ordinal | clmm(nAGQ=20) | 885.50 | 4.18x | 7.67e-61 | *** | 44 | NA |
| InferenceOrdinalOrderedProbitRegr | ordinal | 0.47 | ordinal | clm(probit) | 5.79 | 12.31x | 5.2e-23 | *** | 7 | 4 |
| InferenceOrdinalPropOddsRegr | ordinal | 0.54 | ordinal | clm | 6.00 | 11.07x | 2.19e-22 | *** | 8 | 4 |
This table compares the performance of Full Inference (Model Fit + Standard Error calculation + P-value derivation).
Unlike the point-estimation table above, these results include the computational cost of the variance-covariance matrix (Hessian or Fisher Information) and the Wald test statistic calculation.
All paths (EDI and Canonical) use a reduced sample size ($N=200$) for this full-inference benchmark to ensure iterative stability.
Stratified Cox Exception: For InferenceSurvivalStratCoxPHRegr, the benchmark injects low-cardinality covariates before outcome generation so the row exercises a genuinely stratified Cox fit rather than the unstratified fallback.
EDI regression models (Logistic, Poisson) are benchmarked using the IRLS optimizer for these Wald tests.
Solver-Only Prebuilds: Benchmark setup prebuilds exposed observed-data design matrices, reduced design matrices, strata IDs, and other fixed working inputs outside the timed region when the implementation exposes those hooks. The timed region then measures the full-inference kernel on those fixed inputs.
Limitation: Some canonical comparators only expose formula-based APIs rather than comparable low-level fit kernels. Those rows remain included, but their canonical timings may still contain formula/model-frame overhead beyond the numerical solver, variance, and p-value work itself.
Timing Note: All timings are medians over 30 warmed runs measured with adaptive batched system.time; paths below 0.01 ms use microbenchmark(times = 5000) instead.
Timing P-Value: Timing Pval reports a Welch two-sample t-test comparing the EDI and canonical timing replicate distributions for each row. The unlabeled final column marks thresholds with *** for p < 0.001, ** for p < 0.01, and * for p < 0.05.
Row Highlighting: Light green rows indicate Speedup > 1 and Timing Pval < 0.05; light red rows indicate significant Speedup < 1; light grey rows indicate NA timing comparisons from a failed fit; light blue rows are estimators with no canonical R implementation at all (only EDI is timed, Canonical Time/Speedup/Timing Pval are NA by design).
EDI faster, significant EDI slower, significant NA timing comparison no canonical R implementation
| Class | Response | EDI Time (ms) | Canonical Pkg | Canonical Func | Canonical Time (ms) | Speedup | Timing Pval | EDI Iterations | Canonical Iterations | |
|---|---|---|---|---|---|---|---|---|---|---|
| InferenceAllSimpleAverageDiff | continuous | 0.03 | estimatr | difference_in_means | 1.07 | 41.43x | 2.55e-62 | *** | NA | NA |
| InferenceAllSimpleMeanDiffPooledVar | continuous | 0.02 | stats | t.test(pool) | 0.08 | 3.59x | 7.56e-20 | *** | NA | NA |
| InferenceAllSimpleWilcox | continuous | 0.03 | stats | wilcox.test | 0.34 | 13.4x | 6.97e-73 | *** | NA | NA |
| InferenceContinGLMM (pairs) | continuous | 0.12 | lme4 | lmer(ML)+Wald | 13.00 | 107.28x | 5.26e-52 | *** | NA | NA |
| InferenceContinGLMM (pairs) | continuous | 0.13 | glmmTMB | glmmTMB(gaussian)+Wald | 53.00 | 422.32x | 1.84e-62 | *** | NA | NA |
| InferenceContinLin | continuous | 0.11 | stats | lm.fit(interact)+Wald | 0.26 | 2.37x | 1.39e-59 | *** | NA | NA |
| InferenceContinLin | continuous | 0.11 | estimatr | lm_lin(HC2) | 1.48 | 13.42x | 1.94e-53 | *** | NA | NA |
| InferenceContinOLS | continuous | 9.43e-03 | stats | lm.fit+Wald | 0.04 | 4.06x | 1.3e-19 | *** | NA | NA |
| InferenceContinOLS | continuous | 9.52e-03 | estimatr | lm_robust(classical) | 1.05 | 110.1x | 1.1e-19 | *** | NA | NA |
| InferenceContinQuantileRegr | continuous | 1.17 | quantreg | rq+summary | 1.21 | 1.03x | 4.22e-28 | *** | NA | NA |
| InferenceContinRobustRegr | continuous | 0.03 | MASS | rlm+summary | 0.66 | 19.48x | 4.27e-21 | *** | 10 | NA |
| InferenceContinRobustRegr | continuous | 0.03 | robustbase | lmrob+summary | 11.00 | 326.42x | 1.01e-62 | *** | 10 | NA |
| InferenceIncidExactFisher | incidence | 0.42 | stats | fisher.test | 0.47 | 1.13x | 0.000309 | *** | NA | NA |
| InferenceIncidGCompRiskDiff | incidence | 0.04 | stats | glm+gcomp(RD)+Wald | 1.14 | 26.61x | 1.82e-55 | *** | NA | NA |
| InferenceIncidGCompRiskRatio | incidence | 0.04 | stats | glm+gcomp(RR)+Wald | 1.14 | 28.62x | 4.32e-69 | *** | NA | NA |
| InferenceIncidKKCondLogitGLMMOneLik | incidence | 4.63 | None | no canonical R implementation | NA | NA | NA | NA | NA | |
| InferenceIncidLogBinomial | incidence | 0.19 | stats | glm.fit+Wald(log) | 1.32 | 6.97x | 7.49e-22 | *** | 22 | NA |
| InferenceIncidLogRegr | incidence | 0.04 | stats | glm.fit+Wald | 0.43 | 10.93x | 7.05e-23 | *** | 6 | NA |
| InferenceIncidMiettinenNurminenRiskDiff | incidence | 7.40e-03 | DescTools | BinomDiffCI(mn) | 0.41 | 55.16x | 8.65e-24 | *** | NA | NA |
| InferenceIncidNewcombeRiskDiff | incidence | 0.05 | DescTools | BinomDiffCI(score) | 0.38 | 7.03x | 2.37e-59 | *** | NA | NA |
| InferenceIncidProbitRegr | incidence | 0.07 | stats | glm.fit(probit)+Wald | 0.59 | 8.74x | 3.71e-22 | *** | 9 | NA |
| InferenceIncidRiskDiff | incidence | 9.55e-03 | stats | prop.test | 0.22 | 22.65x | 2.23e-61 | *** | NA | NA |
| fast_logistic_glmm_cpp (pairs, kernel only) | incidence | 13.73 | lme4 | glmer(binomial, nAGQ=20)+Wald | 121.50 | 8.85x | 1.79e-54 | *** | NA | NA |
| fast_logistic_glmm_cpp (pairs, kernel only) | incidence | 13.47 | glmmTMB | glmmTMB(binomial)+Wald | 57.75 | 4.29x | 7.9e-91 | *** | NA | NA |
| InferenceCountGLMM (pairs) | count | 14.77 | lme4 | glmer(poisson, nAGQ=20)+Wald | 153.50 | 10.39x | 3.03e-52 | *** | NA | NA |
| InferenceCountGLMM (pairs) | count | 14.77 | glmmTMB | glmmTMB(poisson)+Wald | 88.00 | 5.96x | 1.41e-73 | *** | NA | NA |
| InferenceCountHurdleNegBin | count | 0.27 | pscl | hurdle(nb)+summary | 8.78 | 32.3x | 2.11e-41 | *** | 20 | NA |
| InferenceCountHurdlePoisson | count | 0.27 | pscl | hurdle+summary | 7.69 | 28.23x | 2.21e-24 | *** | 23 | NA |
| InferenceCountHurdlePoisson (pairs) | count | 0.91 | glmmTMB | glmmTMB(truncated_poisson, zi RE)+Wald | 215.00 | 236.71x | 1.09e-65 | *** | NA | NA |
| InferenceCountKKCondPoissonOneLik | count | 0.04 | None | no canonical R implementation | NA | NA | NA | NA | NA | |
| InferenceCountNegBin | count | 0.14 | MASS | glm.nb+summary | 9.58 | 70.87x | 1.36e-47 | *** | 12 | NA |
| InferenceCountPoisson | count | 0.05 | stats | glm.fit+Wald | 0.64 | 13.8x | 9.89e-24 | *** | 7 | NA |
| InferenceCountQuasiPoisson | count | 0.04 | stats | glm.fit+Wald(quasi) | 0.61 | 15.96x | 4.93e-62 | *** | 6 | NA |
| InferenceCountRobustPoisson | count | 0.09 | sandwich | glm+vcovHC | 3.24 | 37.92x | 2.96e-60 | *** | 7 | NA |
| InferenceCountZeroInflatedNegBin | count | 1.12 | pscl | zeroinfl(nb)+summary | 22.67 | 20.16x | 3.22e-62 | *** | NA | NA |
| InferenceCountZeroInflatedPoisson | count | 0.65 | pscl | zeroinfl+summary | 16.07 | 24.61x | 7.18e-26 | *** | 49 | NA |
| InferencePropBetaRegr | proportion | 0.26 | betareg | betareg+summary | 12.31 | 47.79x | 9.02e-43 | *** | 8 | NA |
| InferencePropGCompMeanDiff | proportion | 0.06 | stats | glm(quasi)+gcomp+Wald | 1.59 | 28.85x | 7.19e-23 | *** | NA | NA |
| InferencePropZeroOneInflatedBetaRegr | proportion | 0.51 | gamlss | gamlss(BEINF)+Wald | 153.50 | 302.98x | 7.43e-68 | *** | NA | NA |
| InferenceSurvivalCoxPHRegr | survival | 0.06 | survival | coxph.fit(breslow)+Wald | 0.24 | 3.72x | 1.16e-37 | *** | 4 | NA |
| InferenceSurvivalGLMMWeibullFrailtyNormalOneLik | survival | 1.08 | parfm | parfm(weibull, lognormal)+Wald | 4210.00 | 3882.8x | 1.05e-09 | *** | NA | NA |
| InferenceSurvivalGehanWilcox | survival | 0.01 | survival | survdiff(rho=1) | 0.93 | 67.49x | 1.27e-48 | *** | NA | NA |
| InferenceSurvivalKMDiff | survival | 1.88 | survival | survfit(median)+CI | 1.88 | 1x | 0.394 | NA | NA | |
| InferenceSurvivalLogRank | survival | 0.07 | survival | survdiff | 2.51 | 35.94x | 7.08e-45 | *** | NA | NA |
| InferenceSurvivalStratCoxPHRegr | survival | 0.26 | survival | coxph.fit(strat)+Wald | 0.34 | 1.33x | 1.87e-08 | *** | 4 | NA |
| InferenceSurvivalWeibullRegr | survival | 0.10 | survival | survreg+summary | 1.92 | 19.61x | 5.99e-43 | *** | 9 | NA |
| InferenceSurvivalWeibullRegr (interval-censored) | survival | 0.17 | survival | survreg(interval2)+summary | 2.15 | 12.69x | 1.86e-21 | *** | NA | NA |
| InferenceSurvivalWeibullRegr (interval-censored) | survival | 0.17 | icenReg | ic_par(aft)+Wald | 5.55 | 32.98x | 4.87e-48 | *** | NA | NA |
| InferenceOrdinalAdjCatLogitRegr | ordinal | 0.10 | VGAM | vglm+summary | 8.02 | 81.07x | 2.45e-45 | *** | 9 | NA |
| InferenceOrdinalCLMM (pairs) | ordinal | 72.00 | ordinal | clmm(nAGQ=20)+Wald | 115.50 | 1.6x | 6.35e-101 | *** | NA | NA |
| InferenceOrdinalContRatioRegr | ordinal | 0.05 | VGAM | vglm+summary | 7.79 | 172.26x | 1.98e-55 | *** | 8 | NA |
| InferenceOrdinalGCompMeanDiff | ordinal | 0.20 | ordinal | clm+gcomp+Wald | 3.66 | 18.58x | 1.26e-60 | *** | NA | NA |
| InferenceOrdinalGLMM (pairs) | ordinal | 34.83 | ordinal | clmm(nAGQ=20)+Wald | 116.50 | 3.34x | 6.88e-72 | *** | NA | NA |
| InferenceOrdinalJonckheereTerpstraTest | ordinal | 0.20 | clinfun | jonckheere | 0.73 | 3.67x | 2.44e-19 | *** | NA | NA |
| InferenceOrdinalPropOddsRegr | ordinal | 0.13 | ordinal | clm+summary | 2.99 | 23.54x | 5.87e-64 | *** | 8 | NA |
| InferenceOrdinalRidit | ordinal | 0.03 | stats | mean(ridit) | 0.15 | 4.54x | 4.3e-18 | *** | NA | NA |
To ensure that the benchmark results are highly precise, reproducible, and represent the actual computation speed of the numerical solvers, the benchmarking harness uses the following garbage collection and cache management strategies:
Garbage collection cycles run automatically by the R interpreter and can introduce significant, arbitrary pauses that skew timing measurements. To isolate the execution time of the code from R's GC overhead:
gctorture(FALSE) before running timing loops.system.time() path, we invoke gc(verbose = FALSE) immediately before timing each replicate. This starts the timer on a clean, compacted heap, minimizing the likelihood of triggering an automatic garbage collection cycle mid-replicate.bench::mark() engine with the filter_gc = TRUE parameter, which automatically tracks and discards timing iterations during which a garbage collection event occurred.Both EDI and canonical timing expressions receive a single validation/warm-up call executed once before the calibration loop begins. This puts the machine code and working data into the instruction and data caches in the same warmed state for both sides, so the official timed replicates start on equal footing.
EDI timings call exported C++ functions directly — no R6 objects are instantiated during benchmarking. As a result, no R6 result caches exist to manage. Each call to the C++ solver (e.g. fast_logistic_regression_cpp, fast_ordinal_regression_cpp) starts from a freshly zero-initialized parameter vector (or a model-specific data-driven initialization when smart_cold_start = TRUE). No prior-fit results are carried across timing repetitions, so every replication is a genuine cold start for the numerical optimizer.
This table is an exhaustive inventory of every fast_* scalar math kernel in EDI/src — used inside the NegBin/Beta/ZINB/Hurdle likelihoods, KK21 negative-binomial fitting, probit cold-start heuristics, ordinal cloglog/cauchit link derivatives, and LRT/score-test p-values — against base R's vectorized equivalents.
Unlike the model-fit tables above, these are not full estimators: each row is a single vectorized special-function evaluation (digamma, trigamma, log-gamma, log-beta, error function, normal CDF/PDF/quantile (both closed-form and log-scale), chi-squared upper-tail p-value, arctangent, softplus, and the mu-parameterized negative-binomial density) over a fixed-length vector, with no design matrix, optimizer, or R6 object involved on either side.
Vector length: All rows evaluate the function over a vector of length $N=5000$; inputs are drawn from a domain realistic for each kernel's actual call sites in EDI (e.g. shape/rate-like values in $(0.5, 50)$ for digamma/trigamma/lgamma, probabilities in $(0, 1)$ for qnorm).
Bare Metal EDI Timing: Eight kernels (digamma, trigamma, lgamma, lbeta, dnbinom_mu, qnorm, log_pnorm, log_dnorm) call the package's own exported fast_*_vec_cpp wrapper (EDI/src/fast_math_utils.cpp, documented and exported via roxygen/NAMESPACE like any other EDI function) directly from the installed package — no separate compile step. The remaining six (pchisq_upper, erfc, pnorm_fast, dnorm_fast, atan, log1pexp) aren't promoted to package exports yet, so those rows call a thin bare-metal wrapper compiled standalone via Rcpp::sourceCpp() against the same EDI/src leaf headers (benchmark/fast_math_utils_bench.cpp) — same convention as benchmark/fast_trigamma_speed_compare.cpp. Either way, the wrapper just loops the internal fast_* scalar kernel over the input vector — no R6, no caching, no warm starts.
Canonical R Timing: The base R column calls the corresponding vectorized base/stats function directly on the same input vector (e.g. digamma(), lgamma(), stats::qnorm(), stats::dnbinom(..., mu = , log = TRUE)).
Timing Note: All timings use the same adaptive batched system.time/microbenchmark harness as the tables above (medians over 30 cold samples; paths below 0.01 ms fall back to microbenchmark(times = 5000)).
Timing P-Value: Timing Pval reports a Welch two-sample t-test comparing the EDI and base R timing replicate distributions for each row. The unlabeled final column marks thresholds with *** for p < 0.001, ** for p < 0.01, and * for p < 0.05.
Row Highlighting: Light green rows indicate Speedup > 1 and Timing Pval < 0.05; light red rows indicate significant Speedup < 1; light grey rows indicate NA timing comparisons from a failed evaluation.
EDI faster, significant EDI slower, significant NA timing comparison no canonical R implementation
| Function | Response | EDI Time (ms) | Canonical Pkg | Canonical Func | Canonical Time (ms) | Speedup | Timing Pval | |
|---|---|---|---|---|---|---|---|---|
| dnorm_fast | utility | 0.03 | base/stats | dnorm | 0.08 | 2.35x | 4.09e-26 | *** |
| fast_atan | utility | 0.02 | base/stats | atan | 0.05 | 2.03x | 5.61e-19 | *** |
| fast_digamma | utility | 0.05 | base/stats | digamma | 0.22 | 4.06x | 2.28e-43 | *** |
| fast_dnbinom_mu | utility | 0.31 | base/stats | dnbinom(mu=, log=TRUE) | 0.39 | 1.25x | 5.86e-07 | *** |
| fast_erfc | utility | 0.05 | base/stats | 2*pnorm(-x*sqrt(2)) | 0.19 | 4.05x | 1.56e-46 | *** |
| fast_lbeta | utility | 0.15 | base/stats | lbeta | 0.44 | 2.93x | 4.58e-61 | *** |
| fast_lgamma | utility | 0.05 | base/stats | lgamma | 0.12 | 2.37x | 8.44e-19 | *** |
| fast_log1pexp | utility | 0.05 | base/stats | log1p(exp(x)) | 0.05 | 1.11x | 0.0246 | * |
| fast_log_dnorm | utility | 0.01 | base/stats | dnorm(log=TRUE) | 0.06 | 4.75x | 1.18e-40 | *** |
| fast_log_pnorm | utility | 0.07 | base/stats | pnorm(log.p=TRUE) | 0.21 | 2.86x | 2.81e-33 | *** |
| fast_pchisq_upper | utility | 0.39 | base/stats | pchisq(lower.tail=FALSE) | 0.84 | 2.12x | 3.15e-76 | *** |
| fast_qnorm | utility | 0.04 | base/stats | qnorm | 0.08 | 2.34x | 1.15e-29 | *** |
| fast_trigamma | utility | 0.02 | base/stats | trigamma | 0.30 | 14.31x | 1.68e-55 | *** |
| pnorm_fast | utility | 0.05 | base/stats | pnorm | 0.17 | 3.22x | 7.23e-35 | *** |
This table times complete inference procedures rather than single model fits: randomization-test p-values and randomization confidence intervals, nonparametric bootstrap confidence intervals, and exact 2x2 inference, each against the dedicated R package for that procedure (ri2, coin, perm, boot, stats::fisher.test).
Data: one completed DesignFixediBCRD design per response type with $N=1000$ subjects (500 for the Cox row), a balanced binary treatment and 4 standard-normal covariates, generated by the same generate_data() as the model-fit tables; the exact-CI row uses a DesignFixedBernoulli design because InferenceIncidExactZhang requires Bernoulli or matching designs. All resampling rows use $r=1000$ randomizations or $B=1000$ (OLS) / $B=500$ (logistic, Cox) bootstrap draws on both sides.
[R6 ...] rows report EDI Total (ms), EDI Construction (ms), and EDI Procedure (ms). Total preserves the public path (InferenceXxx$new(des) plus compute_rand_two_sided_pval(), compute_rand_confidence_interval(), compute_bootstrap_confidence_interval(), or compute_exact_confidence_interval()); construction is measured separately. For procedure samples, the harness constructs a fresh configured inference object immediately before, but outside, each timed batch. This prevents a repeated call from becoming a cache hit without adding a benchmark-only public cache-reset API. Speedup and Timing Pval compare the procedure column with the canonical timing. Kernel rows have no R6 construction, so their construction cell is — and procedure equals total. The completed Design is built once outside every inference measurement. Canonical rows include their own model-frame/object construction (conduct_ri(), oneway_test(), boot()), so both sides pay comparable setup. Both sides run single-threaded (num_cores = 1); EDI's resampling methods can additionally fan out across cores, which is not exercised here.
[kernel ...] rows call the exported C++ kernel directly on prebuilt matrices, including the permutation / bootstrap-index generation (coin, ri2 and boot draw theirs inside the timed call too). compute_simple_mean_diff_parallel_cpp is the kernel InferenceAllSimpleAverageDiff's randomization test runs on, so its [kernel] and [R6] rows bracket the R6 overhead. The two OLS kernels (compute_ols_distr_parallel_cpp, compute_ols_bootstrap_parallel_cpp) are compiled into the package but are not currently called by any R6 class (InferenceContinOLS resamples through the generic reused-worker path), so those rows show attainable rather than currently delivered speed; they are labelled accordingly.
Bootstrap CIs are percentile intervals on both sides (type = "percentile" in EDI, boot.ci(type = "perc")). EDI's default type = "bca" additionally runs a full leave-one-out jackknife for the acceleration constant, which roughly doubles its cost at these sizes and has no boot counterpart without a user-supplied jackknife.
Randomization CIs (test inversion by bisection over the sharp-null shift) have no canonical R implementation (ri2, coin and perm return p-values only), so those rows are light blue with EDI timed alone.
Exact 2x2 inference: EDI implements Fisher's conditional exact test only. InferenceIncidExactFisher wraps stats::fisher.test() directly (its full-inference row is in the Wald table above); InferenceIncidExactZhang evaluates the same conditional p-value through EDI's own C++ kernel zhang_exact_fisher_pval_cpp (timed here against fisher.test()) and inverts it for its exact confidence interval, which is compared against fisher.test()'s conditional-MLE interval. EDI has no unconditional exact test (Barnard / Boschloo), so Exact::exact.test() is deliberately not timed: a comparison would be between different tests.
Not timed: zoib (Bayesian zero-one-inflated beta via JAGS MCMC) in the model-fit tables, for the same like-for-like reason.
Timing Note: medians over 10 warmed runs (5 for the two randomization-CI rows) with the same adaptive batched system.time harness as the tables above; Welch t-test Timing Pval and row colouring as above.
EDI faster, significant EDI slower, significant NA timing comparison no canonical R implementation
| Procedure | Response | EDI Total (ms) | EDI Construction (ms) | EDI Procedure (ms) | Canonical Pkg | Canonical Func | Canonical Time (ms) | Speedup | Timing Pval | |
|---|---|---|---|---|---|---|---|---|---|---|
| Randomization test p-value: mean difference (r = 1000) [kernel] | continuous | 3.58 | — | 3.58 | coin | oneway_test(approximate) | 8.42 | 2.35x | 1.46e-06 | *** |
| Randomization test p-value: mean difference (r = 1000) [kernel] | continuous | 3.74 | — | 3.74 | perm | permTS(exact.mc) | 35.86 | 9.59x | 7.36e-17 | *** |
| Randomization test p-value: mean difference (r = 1000) [kernel] | continuous | 3.63 | — | 3.63 | ri2 | conduct_ri(sims) | 933.50 | 257.16x | 1.23e-18 | *** |
| Randomization test p-value: mean difference (r = 1000) [R6 InferenceAllSimpleAverageDiff] | continuous | 42.21 | 1.34 | 39.75 | coin | oneway_test(approximate) | 8.56 | 0.22x | 7.22e-31 | *** |
| Randomization test p-value: mean difference (r = 1000) [R6 InferenceAllSimpleAverageDiff] | continuous | 41.83 | 1.33 | 34.50 | ri2 | conduct_ri(sims) | 929.00 | 26.93x | 5.56e-18 | *** |
| Randomization test p-value: OLS covariate-adjusted (r = 1000) [kernel, not wired to an R6 class] | continuous | 6.09 | — | 6.09 | ri2 | conduct_ri(y ~ Z + X, sims) | 968.00 | 158.83x | 6.42e-11 | *** |
| Randomization test p-value: OLS covariate-adjusted (r = 1000) [R6 InferenceContinOLS] | continuous | 66.62 | 1.96 | 62.00 | ri2 | conduct_ri(y ~ Z + X, sims) | 978.50 | 15.78x | 1.52e-10 | *** |
| Randomization CI: mean difference (r = 1000, test inversion) [R6 InferenceAllSimpleAverageDiff] | continuous | 143.00 | 1.27 | 143.50 | None | no canonical R implementation | NA | NA | NA | |
| Randomization CI: OLS covariate-adjusted (r = 1000, test inversion) [R6 InferenceContinOLS] | continuous | 125.50 | 2.07 | 118.00 | None | no canonical R implementation | NA | NA | NA | |
| Nonparametric bootstrap CI: OLS (B = 1000) [kernel, not wired to an R6 class] | continuous | 15.03 | — | 15.03 | boot | boot(lm.fit)+boot.ci(perc) | 110.50 | 7.35x | 7.49e-29 | *** |
| Nonparametric bootstrap CI: OLS (B = 1000) [R6 InferenceContinOLS] | continuous | 1886.50 | 2.06 | 790.50 | boot | boot(lm.fit)+boot.ci(perc) | 109.25 | 0.14x | 0.000171 | *** |
| Nonparametric bootstrap CI: logistic regression (B = 500) [R6 InferenceIncidLogRegr] | incidence | 409.00 | 2.28 | 415.50 | boot | boot(glm.fit)+boot.ci(perc) | 536.50 | 1.29x | 0.479 | |
| Nonparametric bootstrap CI: Cox PH (B = 500, n = 500) [R6 InferenceSurvivalCoxPHRegr] | survival | 368.00 | 1.87 | 364.00 | boot | boot(coxph.fit)+boot.ci(perc) | 150.50 | 0.41x | 0.000172 | *** |
| Exact Fisher 2x2 p-value (n = 1000) [kernel zhang_exact_fisher_pval_cpp] | incidence | 0.03 | — | 0.03 | stats | fisher.test | 0.71 | 22.43x | 1.11e-21 | *** |
| Exact CI for the log odds ratio (n = 1000, test inversion) [R6 InferenceIncidExactZhang] | incidence | 3.21 | 0.68 | 2.44 | stats | fisher.test(conf.int) | 0.57 | 0.23x | 1.58e-20 | *** |
This table times the production of one complete treatment allocation for $N=1000$ subjects, from covariate ingestion to the assignment vector, against the dedicated randomization packages (randomizr, nbpMatching, blockTools, carat, Minirand). EDI Total (ms) is the public end-to-end path; EDI Construction (ms) is Design$new() plus fixed-design covariate ingestion (or only construction for the sequential design); EDI Procedure (ms) is assignment, including the 1000 sequential arrivals where applicable. Speedup and Timing Pval use procedure time. Canonical rows receive their covariate table or block ids prebuilt. Fixtures: two factor covariates (3 and 2 levels, i.e. 6 strata) for the blocking and Pocock-Simon rows, four standard-normal covariates for the matching rows.
Honest labelling:
DesignFixedBlocking derives the strata from the factor covariates itself and then delegates the within-block draw to randomizr::block_ra() whenever randomizr is installed, so that row measures EDI's strata construction and R6 overhead on top of the canonical draw.DesignFixedBinaryMatch computes Mahalanobis distances in-house and delegates the optimal nonbipartite matching to nbpMatching::nonbimatch(); the nbpMatching row drives the same optimal matcher directly (gendistance + distancematrix + nonbimatch + within-pair coin flips) and the blockTools row is its greedy (optGreedy) pairing alternative, so the two rows bracket EDI's overhead and the greedy-vs-optimal cost.DesignSeqOneByOnePocockSimon processes the 1000 arrivals one R6 method call at a time, the sequential-trial use case it exists for, while carat::PocSimMIN() receives the whole covariate table at once and runs the sequence in C++ and Minirand is an R loop. The imbalance criteria differ in detail (EDI's weighted marginal $G_k$ with p_best = 0.8 vs carat's and Minirand's Range method at $p = 0.8$).
Timing Note: medians over 10 warmed runs; Welch t-test Timing Pval and row colouring as above.EDI faster, significant EDI slower, significant NA timing comparison no canonical R implementation
| Design | Response | EDI Total (ms) | EDI Construction (ms) | EDI Procedure (ms) | Canonical Pkg | Canonical Func | Canonical Time (ms) | Speedup | Timing Pval | |
|---|---|---|---|---|---|---|---|---|---|---|
| DesignFixediBCRD: complete randomization (n = 1000) | design | 0.83 | 0.77 | 0.05 | randomizr | complete_ra | 0.15 | 3.16x | 5.39e-17 | *** |
| DesignFixedBlocking: strata from 2 factor covariates (6 blocks), n = 1000 | design | 1.50 | 0.81 | 0.63 | randomizr | block_ra(blocks precomputed) | 0.48 | 0.77x | 4.36e-17 | *** |
| DesignFixedBinaryMatch: Mahalanobis optimal pairs + within-pair randomization (4 covariates, n = 1000) | design | 244.50 | 0.83 | 242.50 | nbpMatching | gendistance+nonbimatch+coin flips | 340.50 | 1.4x | 0.000911 | *** |
| DesignFixedBinaryMatch: Mahalanobis optimal pairs + within-pair randomization (4 covariates, n = 1000) | design | 245.50 | 0.83 | 242.00 | blockTools | block(n.tr=2, optGreedy)+assignment | 271.00 | 1.12x | 2.87e-21 | *** |
| DesignSeqOneByOnePocockSimon: 1000 sequential arrivals, 2 factor covariates, p_best = 0.8 | design | 278.00 | 0.58 | 277.50 | carat | PocSimMIN(p = 0.8) | 3.98 | 0.014x | 4.72e-20 | *** |
| DesignSeqOneByOnePocockSimon: 1000 sequential arrivals, 2 factor covariates, p_best = 0.8 | design | 277.50 | 0.58 | 276.00 | Minirand | Minirand(Range, p = 0.8) loop | 995.00 | 3.61x | 1.88e-21 | *** |