--- title: "Performance & Scalability Benchmarks" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Performance & Scalability Benchmarks} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 7, fig.height = 5 ) ``` ## Executive Summary Small Area Estimation often involves large administrative registries or extensive spatial networks with hundreds or thousands of domains. Traditional implementations in R often rely on interpreted loops, pure R Fisher-scoring routines, or large memory allocations for $D \times D$ dense covariance matrices. **fastsae** re-architects core estimation algorithms in compiled C++ using `RcppArmadillo` and native `OpenMP` multi-threading, delivering: - **Up to 364x faster** than `sae` and **12,300x faster** than `emdi` for Fay-Herriot models at $n = 1,000$. - **Up to 80x faster** than `sae` for Spatial Fay-Herriot models at $n = 1,000$. - **Up to 31x faster** than `sae` for Spatio-Temporal models at $n = 1,000$. - **Massive RAM reduction**: Peak memory footprint stays under **25 MB** where existing packages require hundreds of megabytes or several gigabytes. --- ## Benchmark Results Table The following benchmarks were conducted on simulated datasets across domain sizes ranging from $n = 30$ to $n = 1,000$ (with 5 auxiliary covariates): | Metric | `fastsae` | `sae` (Molina & Rao) | `emdi` (Kreutzmann et al.) | |:---|:---:|:---:|:---:| | **Mean Time (EBLUP FH)** | **0.0015 s** | 0.291 s | 9.64 s | | **Mean Time (Spatial FH)** | **0.165 s** | 12.60 s | 8.69 s | | **Mean Time (Spatio-Temporal FH)** | **12.5 s** | 353.0 s | \- | | **Peak Memory (EBLUP FH)** | **0.055 MB** | 16.3 MB | 824 MB | | **Peak Memory (Spatial FH)** | **5.15 MB** | 408 MB | 824 MB | | **Peak Memory (Spatio-Temporal FH)** | **0.289 MB** | 7,822 MB | \- | | **Speedup at n = 1,000 (FH)** | **Baseline** | **~364x slower** | **~12,300x slower** | --- ## Interactive Benchmark Explorer Use the interactive controls below to compare execution time, RAM consumption, and iterations per second across sample sizes: ```{=html}