EDI v1.0.5 Exhaustive C++ Model Fit Benchmarks

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.

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.

Compilation Context

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).

Benchmark Dataset Specification

All 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:

Methodology

Results

EDI faster, significant   EDI slower, significant   NA timing comparison   no canonical R implementation

ClassResponseEDI Time (ms)Canonical PkgCanonical FuncCanonical Time (ms)SpeedupTiming PvalEDI IterationsCanonical Iterations
InferenceAllSimpleWilcoxcontinuous0.08statsHL median pairwise diff1.1915.76x1.65e-19***NANA
InferenceContinGLMM (pairs)continuous0.26lme4lmer(ML)15.5860.49x1.84e-60***9NA
InferenceContinGLMM (pairs)continuous0.26glmmTMBglmmTMB(gaussian)105.00405.46x9.34e-58***9NA
InferenceContinOLScontinuous0.01statslm.fit0.096.89x4.46e-21***NANA
InferenceContinQuantileRegrcontinuous1.08quantregrq.fit1.081x0.351NANA
InferenceContinRobustRegrcontinuous0.11MASSrlm(MM)45.70430.85x1.85e-59***8NA
InferenceContinRobustRegrcontinuous0.11robustbaselmrob.fit(MM)49.00464.36x3.86e-57***89
InferenceIncidBinomialIdentityRiskDiffincidence0.13statsglm.fit(ident)0.816.01x4.06e-18***54
InferenceIncidGCompRiskDiffincidence0.07statsglm.fit+gcomp(RD)0.9012.99x4.28e-15***NANA
InferenceIncidGCompRiskRatioincidence0.08statsglm.fit+gcomp(RR)0.9611.98x1.17e-14***NANA
InferenceIncidKKCondLogitGLMMOneLikincidence12.18Noneno canonical R implementationNANANA7NA
InferenceIncidLogBinomialincidence0.20statsglm.fit(log)1.185.79x4e-20***74
InferenceIncidLogRegrincidence0.06statsglm.fit0.9214.51x1.9e-15***54
InferenceIncidModifiedPoissonincidence0.06statsglm.fit(modified)1.1618.95x1.5e-19***55
InferenceIncidProbitRegrincidence0.17statsglm.fit(probit)1.136.82x1.11e-19***74
InferenceIncidRiskDiffincidence8.35e-03statslm.fit(LPM)0.066.85x3.9e-20***NANA
fast_logistic_glmm_cpp (pairs, kernel only)incidence31.43lme4glmer(binomial, nAGQ=20)218.006.94x7.92e-70***9NA
fast_logistic_glmm_cpp (pairs, kernel only)incidence30.43glmmTMBglmmTMB(binomial)97.333.2x3.24e-74***9NA
InferenceCountGLMM (pairs)count57.25lme4glmer(poisson, nAGQ=20)326.505.7x3.68e-41***21NA
InferenceCountGLMM (pairs)count58.25glmmTMBglmmTMB(poisson)114.001.96x2.83e-82***21NA
InferenceCountHurdleNegBincount1.28psclhurdle(nb)39.5830.9x2.2e-27***21NA
InferenceCountHurdlePoissoncount2.52psclhurdle23.109.16x3.17e-23***65NA
InferenceCountHurdlePoisson (pairs)count2.12glmmTMBglmmTMB(truncated_poisson, zi RE)390.00184.33x1.45e-68***20NA
InferenceCountKKCondPoissonOneLikcount0.05Noneno canonical R implementationNANANA5NA
InferenceCountNegBincount0.49MASSglm.nb12.1524.98x1.04e-58***251
InferenceCountPoissoncount0.09statsglm.fit1.7620.2x5.13e-22***65
InferenceCountQuasiPoissoncount0.11statsglm.fit(quasi)1.5714.09x8.07e-23***75
InferenceCountRobustPoissoncount0.10statsglm.fit1.6916.27x1.16e-26***65
InferenceCountZeroInflatedNegBincount30.00psclzeroinfl(nb)242.008.07x1.71e-26***125227
InferenceCountZeroInflatedPoissoncount3.63psclzeroinfl165.5045.6x1.6e-27***79184
InferencePropBetaRegrproportion0.98betaregbetareg.fit26.3326.73x2.86e-26***714
InferencePropFractionalLogitproportion0.11statsglm.fit(quasi)1.1610.9x9.68e-22***54
InferencePropGCompMeanDiffproportion0.13statsglm.fit(quasi)+gcomp1.188.89x7.48e-14***NANA
InferencePropZeroOneInflatedBetaRegrproportion2.05gamlssgamlss(BEINF)71.6734.91x1.61e-25***234
InferenceSurvivalCoxPHRegrsurvival0.20survivalcoxph.fit(breslow)0.482.35x1.68e-39***44
InferenceSurvivalGLMMWeibullFrailtyNormalOneLiksurvival3.54parfmparfm(weibull, lognormal)17759.005020.87x1.25e-09***7NA
InferenceSurvivalKMDiffsurvival0.01survivalsurvfit(median)3.39270.86x6.14e-24***NANA
InferenceSurvivalLogRanksurvival0.03survivalsurvdiff1.7565.9x3.18e-23***NANA
InferenceSurvivalRestrictedMeanDiffsurvival0.01survivalsurvfit(rmean)2.49171.45x1.99e-48***NANA
InferenceSurvivalStratCoxPHRegrsurvival0.48survivalcoxph.fit(strat)0.651.35x2.54e-66***43
InferenceSurvivalWeibullRegrsurvival0.18survivalsurvreg3.2417.8x2.83e-54***106
InferenceSurvivalWeibullRegr (interval-censored)survival0.42survivalsurvreg(interval2)3.768.97x3.63e-21***95
InferenceSurvivalWeibullRegr (interval-censored)survival0.42icenRegic_par(aft, weibull)14.1333.71x1.47e-57***9NA
InferenceOrdinalAdjCatLogitRegrordinal0.64VGAMvglm(acat)13.1320.66x8.3e-51***105
InferenceOrdinalCLMM (pairs)ordinal247.00ordinalclmm(nAGQ=20)650.002.63x1.33e-73***58NA
InferenceOrdinalCauchitRegrordinal0.54ordinalclm(cauchit)7.6013.95x2.81e-22***107
InferenceOrdinalCloglogRegrordinal0.50ordinalclm(cloglog)6.5913.04x4.17e-53***85
InferenceOrdinalContRatioRegrordinal0.19VGAMvglm(cratio)12.0062.21x4.46e-51***95
InferenceOrdinalGCompMeanDiffordinal0.56ordinalclm+gcomp11.5620.78x3.81e-48***NANA
InferenceOrdinalGLMM (pairs)ordinal212.00ordinalclmm(nAGQ=20)885.504.18x7.67e-61***44NA
InferenceOrdinalOrderedProbitRegrordinal0.47ordinalclm(probit)5.7912.31x5.2e-23***74
InferenceOrdinalPropOddsRegrordinal0.54ordinalclm6.0011.07x2.19e-22***84

Wald Test Performance (Full Inference)

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

ClassResponseEDI Time (ms)Canonical PkgCanonical FuncCanonical Time (ms)SpeedupTiming PvalEDI IterationsCanonical Iterations
InferenceAllSimpleAverageDiffcontinuous0.03estimatrdifference_in_means1.0741.43x2.55e-62***NANA
InferenceAllSimpleMeanDiffPooledVarcontinuous0.02statst.test(pool)0.083.59x7.56e-20***NANA
InferenceAllSimpleWilcoxcontinuous0.03statswilcox.test0.3413.4x6.97e-73***NANA
InferenceContinGLMM (pairs)continuous0.12lme4lmer(ML)+Wald13.00107.28x5.26e-52***NANA
InferenceContinGLMM (pairs)continuous0.13glmmTMBglmmTMB(gaussian)+Wald53.00422.32x1.84e-62***NANA
InferenceContinLincontinuous0.11statslm.fit(interact)+Wald0.262.37x1.39e-59***NANA
InferenceContinLincontinuous0.11estimatrlm_lin(HC2)1.4813.42x1.94e-53***NANA
InferenceContinOLScontinuous9.43e-03statslm.fit+Wald0.044.06x1.3e-19***NANA
InferenceContinOLScontinuous9.52e-03estimatrlm_robust(classical)1.05110.1x1.1e-19***NANA
InferenceContinQuantileRegrcontinuous1.17quantregrq+summary1.211.03x4.22e-28***NANA
InferenceContinRobustRegrcontinuous0.03MASSrlm+summary0.6619.48x4.27e-21***10NA
InferenceContinRobustRegrcontinuous0.03robustbaselmrob+summary11.00326.42x1.01e-62***10NA
InferenceIncidExactFisherincidence0.42statsfisher.test0.471.13x0.000309***NANA
InferenceIncidGCompRiskDiffincidence0.04statsglm+gcomp(RD)+Wald1.1426.61x1.82e-55***NANA
InferenceIncidGCompRiskRatioincidence0.04statsglm+gcomp(RR)+Wald1.1428.62x4.32e-69***NANA
InferenceIncidKKCondLogitGLMMOneLikincidence4.63Noneno canonical R implementationNANANANANA
InferenceIncidLogBinomialincidence0.19statsglm.fit+Wald(log)1.326.97x7.49e-22***22NA
InferenceIncidLogRegrincidence0.04statsglm.fit+Wald0.4310.93x7.05e-23***6NA
InferenceIncidMiettinenNurminenRiskDiffincidence7.40e-03DescToolsBinomDiffCI(mn)0.4155.16x8.65e-24***NANA
InferenceIncidNewcombeRiskDiffincidence0.05DescToolsBinomDiffCI(score)0.387.03x2.37e-59***NANA
InferenceIncidProbitRegrincidence0.07statsglm.fit(probit)+Wald0.598.74x3.71e-22***9NA
InferenceIncidRiskDiffincidence9.55e-03statsprop.test0.2222.65x2.23e-61***NANA
fast_logistic_glmm_cpp (pairs, kernel only)incidence13.73lme4glmer(binomial, nAGQ=20)+Wald121.508.85x1.79e-54***NANA
fast_logistic_glmm_cpp (pairs, kernel only)incidence13.47glmmTMBglmmTMB(binomial)+Wald57.754.29x7.9e-91***NANA
InferenceCountGLMM (pairs)count14.77lme4glmer(poisson, nAGQ=20)+Wald153.5010.39x3.03e-52***NANA
InferenceCountGLMM (pairs)count14.77glmmTMBglmmTMB(poisson)+Wald88.005.96x1.41e-73***NANA
InferenceCountHurdleNegBincount0.27psclhurdle(nb)+summary8.7832.3x2.11e-41***20NA
InferenceCountHurdlePoissoncount0.27psclhurdle+summary7.6928.23x2.21e-24***23NA
InferenceCountHurdlePoisson (pairs)count0.91glmmTMBglmmTMB(truncated_poisson, zi RE)+Wald215.00236.71x1.09e-65***NANA
InferenceCountKKCondPoissonOneLikcount0.04Noneno canonical R implementationNANANANANA
InferenceCountNegBincount0.14MASSglm.nb+summary9.5870.87x1.36e-47***12NA
InferenceCountPoissoncount0.05statsglm.fit+Wald0.6413.8x9.89e-24***7NA
InferenceCountQuasiPoissoncount0.04statsglm.fit+Wald(quasi)0.6115.96x4.93e-62***6NA
InferenceCountRobustPoissoncount0.09sandwichglm+vcovHC3.2437.92x2.96e-60***7NA
InferenceCountZeroInflatedNegBincount1.12psclzeroinfl(nb)+summary22.6720.16x3.22e-62***NANA
InferenceCountZeroInflatedPoissoncount0.65psclzeroinfl+summary16.0724.61x7.18e-26***49NA
InferencePropBetaRegrproportion0.26betaregbetareg+summary12.3147.79x9.02e-43***8NA
InferencePropGCompMeanDiffproportion0.06statsglm(quasi)+gcomp+Wald1.5928.85x7.19e-23***NANA
InferencePropZeroOneInflatedBetaRegrproportion0.51gamlssgamlss(BEINF)+Wald153.50302.98x7.43e-68***NANA
InferenceSurvivalCoxPHRegrsurvival0.06survivalcoxph.fit(breslow)+Wald0.243.72x1.16e-37***4NA
InferenceSurvivalGLMMWeibullFrailtyNormalOneLiksurvival1.08parfmparfm(weibull, lognormal)+Wald4210.003882.8x1.05e-09***NANA
InferenceSurvivalGehanWilcoxsurvival0.01survivalsurvdiff(rho=1)0.9367.49x1.27e-48***NANA
InferenceSurvivalKMDiffsurvival1.88survivalsurvfit(median)+CI1.881x0.394NANA
InferenceSurvivalLogRanksurvival0.07survivalsurvdiff2.5135.94x7.08e-45***NANA
InferenceSurvivalStratCoxPHRegrsurvival0.26survivalcoxph.fit(strat)+Wald0.341.33x1.87e-08***4NA
InferenceSurvivalWeibullRegrsurvival0.10survivalsurvreg+summary1.9219.61x5.99e-43***9NA
InferenceSurvivalWeibullRegr (interval-censored)survival0.17survivalsurvreg(interval2)+summary2.1512.69x1.86e-21***NANA
InferenceSurvivalWeibullRegr (interval-censored)survival0.17icenRegic_par(aft)+Wald5.5532.98x4.87e-48***NANA
InferenceOrdinalAdjCatLogitRegrordinal0.10VGAMvglm+summary8.0281.07x2.45e-45***9NA
InferenceOrdinalCLMM (pairs)ordinal72.00ordinalclmm(nAGQ=20)+Wald115.501.6x6.35e-101***NANA
InferenceOrdinalContRatioRegrordinal0.05VGAMvglm+summary7.79172.26x1.98e-55***8NA
InferenceOrdinalGCompMeanDiffordinal0.20ordinalclm+gcomp+Wald3.6618.58x1.26e-60***NANA
InferenceOrdinalGLMM (pairs)ordinal34.83ordinalclmm(nAGQ=20)+Wald116.503.34x6.88e-72***NANA
InferenceOrdinalJonckheereTerpstraTestordinal0.20clinfunjonckheere0.733.67x2.44e-19***NANA
InferenceOrdinalPropOddsRegrordinal0.13ordinalclm+summary2.9923.54x5.87e-64***8NA
InferenceOrdinalRiditordinal0.03statsmean(ridit)0.154.54x4.3e-18***NANA

Garbage Collection and Cache Management

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:

1. Garbage Collection (GC) Filtering

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:

2. Cold-Start Guarantee for EDI and Symmetric Warm-Up for Both Sides

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.

Utility / Math Kernel Performance

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

FunctionResponseEDI Time (ms)Canonical PkgCanonical FuncCanonical Time (ms)SpeedupTiming Pval
dnorm_fastutility0.03base/statsdnorm0.082.35x4.09e-26***
fast_atanutility0.02base/statsatan0.052.03x5.61e-19***
fast_digammautility0.05base/statsdigamma0.224.06x2.28e-43***
fast_dnbinom_muutility0.31base/statsdnbinom(mu=, log=TRUE)0.391.25x5.86e-07***
fast_erfcutility0.05base/stats2*pnorm(-x*sqrt(2))0.194.05x1.56e-46***
fast_lbetautility0.15base/statslbeta0.442.93x4.58e-61***
fast_lgammautility0.05base/statslgamma0.122.37x8.44e-19***
fast_log1pexputility0.05base/statslog1p(exp(x))0.051.11x0.0246*
fast_log_dnormutility0.01base/statsdnorm(log=TRUE)0.064.75x1.18e-40***
fast_log_pnormutility0.07base/statspnorm(log.p=TRUE)0.212.86x2.81e-33***
fast_pchisq_upperutility0.39base/statspchisq(lower.tail=FALSE)0.842.12x3.15e-76***
fast_qnormutility0.04base/statsqnorm0.082.34x1.15e-29***
fast_trigammautility0.02base/statstrigamma0.3014.31x1.68e-55***
pnorm_fastutility0.05base/statspnorm0.173.22x7.23e-35***

Resampling-Based Inference Procedure Performance

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

ProcedureResponseEDI Total (ms)EDI Construction (ms)EDI Procedure (ms)Canonical PkgCanonical FuncCanonical Time (ms)SpeedupTiming Pval
Randomization test p-value: mean difference (r = 1000) [kernel]continuous3.58—3.58coinoneway_test(approximate)8.422.35x1.46e-06***
Randomization test p-value: mean difference (r = 1000) [kernel]continuous3.74—3.74permpermTS(exact.mc)35.869.59x7.36e-17***
Randomization test p-value: mean difference (r = 1000) [kernel]continuous3.63—3.63ri2conduct_ri(sims)933.50257.16x1.23e-18***
Randomization test p-value: mean difference (r = 1000) [R6 InferenceAllSimpleAverageDiff]continuous42.211.3439.75coinoneway_test(approximate)8.560.22x7.22e-31***
Randomization test p-value: mean difference (r = 1000) [R6 InferenceAllSimpleAverageDiff]continuous41.831.3334.50ri2conduct_ri(sims)929.0026.93x5.56e-18***
Randomization test p-value: OLS covariate-adjusted (r = 1000) [kernel, not wired to an R6 class]continuous6.09—6.09ri2conduct_ri(y ~ Z + X, sims)968.00158.83x6.42e-11***
Randomization test p-value: OLS covariate-adjusted (r = 1000) [R6 InferenceContinOLS]continuous66.621.9662.00ri2conduct_ri(y ~ Z + X, sims)978.5015.78x1.52e-10***
Randomization CI: mean difference (r = 1000, test inversion) [R6 InferenceAllSimpleAverageDiff]continuous143.001.27143.50Noneno canonical R implementationNANANA
Randomization CI: OLS covariate-adjusted (r = 1000, test inversion) [R6 InferenceContinOLS]continuous125.502.07118.00Noneno canonical R implementationNANANA
Nonparametric bootstrap CI: OLS (B = 1000) [kernel, not wired to an R6 class]continuous15.03—15.03bootboot(lm.fit)+boot.ci(perc)110.507.35x7.49e-29***
Nonparametric bootstrap CI: OLS (B = 1000) [R6 InferenceContinOLS]continuous1886.502.06790.50bootboot(lm.fit)+boot.ci(perc)109.250.14x0.000171***
Nonparametric bootstrap CI: logistic regression (B = 500) [R6 InferenceIncidLogRegr]incidence409.002.28415.50bootboot(glm.fit)+boot.ci(perc)536.501.29x0.479
Nonparametric bootstrap CI: Cox PH (B = 500, n = 500) [R6 InferenceSurvivalCoxPHRegr]survival368.001.87364.00bootboot(coxph.fit)+boot.ci(perc)150.500.41x0.000172***
Exact Fisher 2x2 p-value (n = 1000) [kernel zhang_exact_fisher_pval_cpp]incidence0.03—0.03statsfisher.test0.7122.43x1.11e-21***
Exact CI for the log odds ratio (n = 1000, test inversion) [R6 InferenceIncidExactZhang]incidence3.210.682.44statsfisher.test(conf.int)0.570.23x1.58e-20***

Design Generation Performance

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:

EDI faster, significant   EDI slower, significant   NA timing comparison   no canonical R implementation

DesignResponseEDI Total (ms)EDI Construction (ms)EDI Procedure (ms)Canonical PkgCanonical FuncCanonical Time (ms)SpeedupTiming Pval
DesignFixediBCRD: complete randomization (n = 1000)design0.830.770.05randomizrcomplete_ra0.153.16x5.39e-17***
DesignFixedBlocking: strata from 2 factor covariates (6 blocks), n = 1000design1.500.810.63randomizrblock_ra(blocks precomputed)0.480.77x4.36e-17***
DesignFixedBinaryMatch: Mahalanobis optimal pairs + within-pair randomization (4 covariates, n = 1000)design244.500.83242.50nbpMatchinggendistance+nonbimatch+coin flips340.501.4x0.000911***
DesignFixedBinaryMatch: Mahalanobis optimal pairs + within-pair randomization (4 covariates, n = 1000)design245.500.83242.00blockToolsblock(n.tr=2, optGreedy)+assignment271.001.12x2.87e-21***
DesignSeqOneByOnePocockSimon: 1000 sequential arrivals, 2 factor covariates, p_best = 0.8design278.000.58277.50caratPocSimMIN(p = 0.8)3.980.014x4.72e-20***
DesignSeqOneByOnePocockSimon: 1000 sequential arrivals, 2 factor covariates, p_best = 0.8design277.500.58276.00MinirandMinirand(Range, p = 0.8) loop995.003.61x1.88e-21***