Benchmark charts
Speedup distribution
Each dot is one finalized dataset/thread run on WindowsThread sweep
Speedup across finalized thread counts on WindowsMemory
Baseline vs optimized peak memory on WindowsWhat is accelerated
This task targets clusterProfiler::compareCluster in clusterProfiler. The benchmarked result
preserves the declared scientific output gate while reducing CPU runtime on the listed datasets.
Also searched as: enrichment, GO enrichment, pathway enrichment, over-representation, ORA, GSEA, compareCluster.
Supported scope
Correctly accelerates the GO over-representation (ORA) workflow: compareCluster(geneClusters = <named list of character gene-ID vectors>, fun = "enrichGO", OrgDb, keyType, ont in {ALL,BP,CC,MF}, pvalueCutoff/qvalueCutoff/pAdjustMethod/minGSSize/maxGSSize at any value). Read full supported scope
Correctly accelerates the GO over-representation (ORA) workflow: compareCluster(geneClusters = <named list of character gene-ID vectors>, fun = "enrichGO", OrgDb, keyType, ont in {ALL,BP,CC,MF}, pvalueCutoff/qvalueCutoff/pAdjustMethod/minGSSize/maxGSSize at any value). Three coordinated overrides: (1) fast_get_GO_data caches the per-(organism, ont, keytype) PATHID2EXTID/EXTID2PATHID/PATHID2NAME/GO2ONT plus ZYME_ALLEXTID/ZYME_TERM_LENGTHS into the shared .Anno_clusterProfiler_Env, building all 4 ont entries from one mapIds + split; (2) fast_enricher_internal vectorizes phyper and uses cached extID/term-length when universe is NULL (the compareCluster default) — this is bound to BOTH clusterProfiler::enricher_internal and DOSE::enricher_internal, so it also correctly handles any other ORA fun (enrichKEGG/enrichDO/etc.) by falling back to .ALLEXTID_fn/lengths() when the GO cache keys are absent; (3) fast_compareCluster fans the independent per-cluster fun() calls across cores via .zyme_mclapply (lapply fallback on Windows or threads<=1), applies the exact pvalue<=cutoff & p.adjust<=cutoff then qvalue<=cutoff filtering that upstream get_enriched/as.data.frame applies, and rebuilds the compareClusterResult. fun may be any character name resolvable in the clusterProfiler namespace or a function object. universe handling is preserved: character universe intersects (or replaces, under options(enrichment_force_universe=TRUE)); non-character universe is ignored with a message, matching upstream. Concordance verified at term_jaccard=1, pearson_logp_shared=1, max_abs_logp_diff=0 for the benchmarked GO-ALL/ENTREZID config (human pbmc + mouse OOD tiers).
Out-of-scope behavior
silent fallback to upstream
Show detailed speedup table 10 runs
| Dataset | Tier | Platform | Threads | Baseline | Optimized | Speedup | Memory | Concordance | Pass |
|---|---|---|---|---|---|---|---|---|---|
gastrulation_pijuansala | ood_large | Windows | 8 | 10.75 min | 22.97 s | 27.6× | 3.5 → 3.6 GB | — | pass |
heart_adult | large | Windows | 8 | 8.75 min | 20.35 s | 25.6× | 3.1 → 3.1 GB | — | pass |
pbmc200k_glaucoma | medium | Windows | 8 | 8.11 min | 22.11 s | 20.3× | 3.0 → 3.1 GB | — | pass |
pbmc68k | small | Windows | 8 | 4.42 min | 21.60 s | 13.1× | 3.1 → 3.1 GB | — | pass |
tms_ss2 | ood_xlarge | Windows | 4 | 37.64 min | 24.88 s | 90.8× | 3.0 → 3.6 GB | — | pass |
gastrulation_pijuansala | ood_large | macOS | 4 | 7.73 min | 35.24 s | 13.1× | 4.5 → 2.6 GB | — | pass |
heart_adult | large | macOS | 4 | 5.75 min | 18.43 s | 18.7× | 4.2 → 2.4 GB | — | pass |
pbmc200k_glaucoma | medium | macOS | 4 | 3.94 min | 17.79 s | 13.4× | 4.1 → 2.4 GB | — | pass |
pbmc68k | small | macOS | 1 | 2.81 min | 13.46 s | 12.6× | 3.9 → 2.4 GB | — | pass |
tms_ss2 | ood_xlarge | macOS | 4 | 24.10 min | 26.05 s | 54.8× | 4.8 → 2.8 GB | — | pass |
Frequently asked questions
Why is clusterProfiler slow?
clusterProfiler is CPU-bound, and the stock implementation in clusterProfiler leaves performance on the table in its core numerical work. On the benchmark datasets the original takes 37.64 min where the AutoZyme path takes 24.88 s (90.8× faster).
How do I make clusterProfiler faster?
Install AutoZyme and activate the clusterProfiler patch, then keep using clusterProfiler exactly as before. AutoZyme transparently substitutes the faster, output-validated path, up to 90.8× faster on the benchmark datasets, with no pipeline or API changes.
Does the AutoZyme speedup change the clusterProfiler output?
No. The accelerated path returns bit-for-bit identical results to the original clusterProfiler implementation (maximum absolute difference 0), checked by a frozen concordance gate on every benchmark dataset.
How do I install the clusterProfiler speedup?
In R: install the autozyme package, then run library(autozyme) and autozyme::activate("clusterprofiler"). The patch applies automatically the next time you call clusterProfiler::compareCluster.