R Trajectory & dynamics slingshot

Speed up Slingshot

Slingshot is one of the slower steps in many single-cell genomics workflows. AutoZyme ships a verified, drop-in patch that is up to 3.61× faster, returning output within a validated, bounded difference with no change to how you call it.

Best speedup 3.61×
Median speedup 3.60×
Output equivalence Bounded
Best runtime baseline 1.01 min optimized 16.79 s
Datasets 5
Pass rate 10/10

Benchmark charts

Switch benchmark platform; all charts update together
Platform
Speedup distribution
Each dot is one finalized dataset/thread run on Windows
pbmc68k_tinygastrulation_ood_xlar…pbmc200k_glaucoma_lar…gastrulation_ood_largepbmc68k_medium
Thread sweep
Speedup across finalized thread counts on Windows
No finalized multi-thread sweep for this platform.
Memory
Baseline vs optimized peak memory on Windows
0.0 GB1.0 GB2.0 GBgastrulation_ood_…0.98×pbmc200k_glaucoma…1.00×pbmc68k_medium0.99×gastrulation_ood_…1.10×pbmc68k_tiny0.98×gastrulation_ood_xlarge · ood_xlargememory 1.4 GB → 1.3 GBoptimized / baseline 0.98×2.35× speedup · 1 threadspbmc200k_glaucoma_large · largememory 1.1 GB → 1.1 GBoptimized / baseline 1.00×2.22× speedup · 1 threadspbmc68k_medium · mediummemory 1.0 GB → 1.0 GBoptimized / baseline 0.99×2.03× speedup · 1 threadsgastrulation_ood_large · ood_largememory 1.0 GB → 1.1 GBoptimized / baseline 1.10×2.13× speedup · 1 threadspbmc68k_tiny · smallmemory 0.9 GB → 0.9 GBoptimized / baseline 0.98×3.61× speedup · 1 threads
baselineoptimized

What is accelerated

The public API stays the same; AutoZyme replaces only the supported fast path.

This task targets slingshot::slingshot in slingshot. The benchmarked result preserves the declared scientific output gate while reducing CPU runtime on the listed datasets.

Also searched as: trajectory, pseudotime, lineage, trajectory inference.

Supported scope

The patch replaces only the S4 method getCurves,PseudotimeOrdering (the curve-fitting stage that slingshot() invokes internally after getLineages); the lineage/MST inference stage of slingshot() (start.clus, end.clus, dist.method, use.median, omega,… Read full supported scope

The patch replaces only the S4 method getCurves,PseudotimeOrdering (the curve-fitting stage that slingshot() invokes internally after getLineages); the lineage/MST inference stage of slingshot() (start.clus, end.clus, dist.method, use.median, omega, omega_scale, times) is NOT patched and runs upstream unchanged. fast_getCurves reimplements the full getCurves parameter surface and branches on every algorithmic argument: shrink (logical or numeric in [0,1]), extend in {"y","n","pc1"}, reweight, reassign, thresh, maxit, stretch, approx_points (NULL->150 if nrow>150 else FALSE, or explicit), smoother in {"smooth.spline","loess"}, shrink.method (passed through to slingshot's .percent_shrinkage), and allow.breaks. It handles single-lineage (L=1 -> sequential lapply), single-cluster (K=1, PCA extension), and multi-cluster branching/shrinkage. There are no NotImplementedError/stop() guards that reject any parameter value, so it nominally accepts the whole getCurves API. The benchmarked default config (shrink=TRUE, extend="y", reweight=TRUE, reassign=TRUE, smoother="smooth.spline", approx_points=NULL) is fully exercised and passes the task metric thresholds. CRITICAL CAVEAT: even within its supported scope the fast path is an APPROXIMATION, not bit-exact: (1) smooth.spline spar caching reuses the previous fit's spar across coordinate dimensions when lambda/weights match, bypassing the per-dim df-search cross-validation; (2) the smoother returns fit$y[match(lambda,fit$x)] instead of predict.smooth.spline; (3) the initial curve skeleton is resampled to approx_points BEFORE the second full-data projection (upstream projects onto the dense skeleton then resamples). These degrade pseudotime_spearman/weight_pearson below 1.0 (about 0.985 / 0.970 on the tiny tier per the audit) even at default args.

Out-of-scope behavior

silent possibly wrong

Show detailed speedup table 10 runs
Dataset Tier Platform Threads Baseline Optimized Speedup Memory Concordance Pass
gastrulation_ood_large ood_large Windows 1 5.31 min 2.49 min 2.13× 1.0 → 1.1 GB pass
gastrulation_ood_xlarge ood_xlarge Windows 1 22.01 min 9.37 min 2.35× 1.4 → 1.3 GB pass
pbmc200k_glaucoma_large large Windows 1 6.97 min 3.14 min 2.22× 1.1 → 1.1 GB pass
pbmc68k_medium medium Windows 1 3.67 min 1.81 min 2.03× 1.0 → 1.0 GB pass
pbmc68k_tiny small Windows 1 1.01 min 16.79 s 3.61× 0.9 → 0.9 GB pass
gastrulation_ood_large ood_large macOS 1 4.12 min 1.14 min 3.60× 1.8 → 1.4 GB pass
gastrulation_ood_xlarge ood_xlarge macOS 1 19.49 min 3.30 min 5.91× 2.7 → 1.9 GB pass
pbmc200k_glaucoma_large large macOS 1 7.12 min 1.32 min 5.41× 1.8 → 1.4 GB pass
pbmc68k_medium medium macOS 1 3.72 min 56.11 s 3.98× 1.6 → 1.2 GB pass
pbmc68k_tiny small macOS 1 59.82 s 6.67 s 8.96× 1.2 → 0.9 GB pass

Frequently asked questions

Speeding up Slingshot
Why is Slingshot slow?

Slingshot is CPU-bound, and the stock implementation in slingshot leaves performance on the table in its core numerical work. On the benchmark datasets the original takes 1.01 min where the AutoZyme path takes 16.79 s (3.61× faster).

How do I make Slingshot faster?

Install AutoZyme and activate the slingshot patch, then keep using Slingshot exactly as before. AutoZyme transparently substitutes the faster, output-validated path, up to 3.61× faster on the benchmark datasets, with no pipeline or API changes.

Does the AutoZyme speedup change the Slingshot output?

Differences are small and bounded: concordance-validated to within roughly 1.5 to 5% of the original slingshot result on every benchmark dataset, inside a frozen gate.

How do I install the slingshot speedup?

In R: install the autozyme package, then run library(autozyme) and autozyme::activate("slingshot"). The patch applies automatically the next time you call slingshot::slingshot.