30 Benchmarks · 2 Platforms

BioLang Performance

30 bioinformatics tasks benchmarked against Python (BioPython) and R (Bioconductor) on synthetic and real-world data from NCBI, UniProt, ClinVar, ENCODE, and Ensembl.

Best of 3 runs · Wall-clock time · bl 1.1.0

These figures are current, re-measured on bl 1.1.0 in August 2026.

They are wall-clock times for a whole script, so they include interpreter startup and library imports — import Bio alone costs 400 ms or more, which is most of the gap on the smaller tasks. They are not per-operation measurements, and the runtime has changed a great deal since: among other things unique() and push() were quadratic and are not any more. For current per-operation numbers against BioPython and edlib, including the tasks where BioLang loses, see bench/harness.py, which is reproducible from a seed.

Current per-operation results

Produced by bench/harness.py inside bench/Dockerfile, which pins BioLang, Python and R in one image so all three are measured by the same kernel and the same CPU. Median of 10 runs after 2 discarded, with the median absolute deviation beside it.

BioLang is fastest in 4 of the 12 workloads. The pattern is consistent and worth more than any single number: it wins where a Rust builtin does the work, and loses by three to eleven times wherever the work happens in interpreted BioLang. Against a C library — edlib, pydivsufsort — it loses too.

Every implementation is checked to return the same answer before any timing is believed; this run had no disagreements. A container fixes reproducibility, not fairness — the two worst bugs this harness has had were design bugs, and an image would have reproduced both faithfully. One of them recurred while these very workloads were being added: the Viterbi comparison charged BioLang 91 ms of interpreted string building and reported it as decode time, making a 4× gap look like 19×.

Workload Implementation Median MAD Relative
reverse complement (1 Mb)Biopython2.7 ms±0.1fastest
Python stdlib2.9 ms±0.11.1× slower
BioLang5.9 ms±0.12.2× slower
GC content (1 Mb)BioLang4.1 ms±0.1fastest
Python stdlib6.3 ms±0.11.5× slower
Biopython12.4 ms±0.13.0× slower
translation (1 Mb -> protein)BioLang3.8 ms±0.0fastest
Biopython43.1 ms±0.311.4× slower
edit distance (2 kb x 2 kb)edlib (C)3.4 ms±0.1fastest
BioLang6.8 ms±0.12.0× slower
Biopython11.8 ms±0.13.5× slower
FASTA parse (1000 reads)Biopython1.4 ms±0.1fastest
BioLang4.5 ms±0.13.3× slower
k-mer counting (k=8, 1 Mb)Python dict83.3 ms±2.0fastest
BioLang395.2 ms±22.64.7× slower
interpreted loop (300k iterations)Python6.2 ms±0.0fastest
BioLang68.9 ms±0.211.2× slower
Viterbi decode (2-state HMM, 100k symbols)hmmlearn (NumPy)5.4 ms±0.3fastest
BioLang28.9 ms±0.55.4× slower
pure Python130.9 ms±3.224.4× slower
suffix array (200 kb)pydivsufsort (C)11.1 ms±1.8fastest
BioLang41.8 ms±0.33.8× slower
pure Python680.9 ms±81.461.5× slower
reversal distance (length-10 permutations)BioLang510.0 ms±8.8fastest
pure Python BFS877.1 ms±30.51.7× slower
GC content (1 Mb) — with RBioLang3.7 ms±0.0fastest
Biopython11.6 ms±0.13.2× slower
R Biostrings105.6 ms±2.128.8× slower
reverse complement (1 Mb) — with RBiopython2.4 ms±0.1fastest
BioLang5.4 ms±0.12.2× slower
R Biostrings6.0 ms±0.32.5× slower

Linux 6.6.87.2-microsoft-standard-WSL2 (x86_64) · BioLang 1.1.0 · Python 3.12.3 · BioPython 1.85 · input 1,000,000 bp synthetic genome, 1000 x 300 bp reads. Reproduce with docker build -f bench/Dockerfile -t biolang-bench . then docker run --rm -v "$PWD/bench:/out" biolang-bench.

7.1x
ENCODE Overlap
0.363s vs 2.574s (Py)
7.0x
Protein K-mers
0.191s vs 1.331s (Py)
6.7x
FASTA Parse
0.138s vs 0.926s (Py)
3.2x
K-mer Counting
6.551s vs 21.01s (Py)

Full Results

All 30 tasks across 6 categories. Click tabs to switch platforms.

Linux (WSL2) — Intel i9-12900K, 16 GB RAM — BioLang 0.3.0, Python 3.12.3, R 4.3.3

Task BioLang Python R Speedup vs Py
Sequence I/O
FASTA Small (30 KB)0.138s0.926s1.243s6.7x
FASTA Medium (4.6 MB)0.170s0.991s1.371s5.8x
FASTA Statistics0.995s1.590s1.764s1.6x
FASTA Large (51 MB)0.821s1.649s2.103s2.0x
FASTA gzipped (1.3 MB)0.141s0.930s1.327s6.6x
FASTQ QC1.960s3.551s4.404s1.8x
Real-world Genomes
E. coli Genome0.176s1.081s1.354s6.1x
Human Chr221.126s1.673s2.092s1.5x
GC Content (51 MB)0.830s2.771s2.358s3.3x
K-mer Analysis
K-mer Counting6.551s21.01s3.2x
Chr22 21-mers10.72s28.73s2.7x
Protein K-mers0.191s1.331s1.298s7.0x
Intervals & Overlaps
ENCODE Peak Overlap0.363s2.574s7.1x
Write Filtered FASTA0.821s1.679s4.924s2.0x
Variant & Data
VCF Filtering0.349s0.166s6.312sPy 2.1x faster
ClinVar Variants0.661s0.265s1.208sPy 2.5x faster
CSV Join + Group-by0.281s0.156s0.312sPy 1.8x faster
GFF3 Ensembl chr220.453s0.171sPy 2.6x faster
BED Overlap (synthetic)0.160s0.067s1.279sPy 2.4x faster
Pipelines
FASTQ QC Pipeline2.349s5.059s2.2x
Variant Analysis Pipeline0.268s0.177sPy 1.5x faster
ClinVar Variant Pipeline0.591s0.261sPy 2.3x faster
Multi-Sample Aggregation0.245s0.090sPy 2.7x faster
RNA-seq DE Analysis0.114s0.054sPy 2.1x faster
Variant Annotation0.309s0.122sPy 2.5x faster
ClinVar + Ensembl Annotation0.409s0.183sPy 2.2x faster

Amber rows: Python wins on VCF/CSV/GFF text parsing and pipeline orchestration where Python's regex, csv, and dict modules are highly optimized C extensions. BioLang excels at I/O-heavy and compute-heavy tasks (FASTA/FASTQ parsing, k-mer counting, interval overlaps).

K-mer counting uses canonical (strand-agnostic) 21-mers in BioLang vs forward-only in Python — BioLang does strictly more work.

Methodology

Hardware

  • CPU: Intel Core i9-12900K (16C/24T)
  • Linux: WSL2, 16 GB RAM
  • Windows: Windows 11 Pro, 32 GB RAM
  • Storage: NVMe SSD

Measurement

  • Runs: Best of 3, wall-clock time
  • BioLang: v0.3.0 (tree-walking interpreter)
  • Python: 3.12.3 (Linux) / 3.12.4 (Windows)
  • R: 4.3.3 (Linux only)

Data Sources

  • Synthetic: Generated FASTA/FASTQ/VCF/BED/CSV
  • Real-world: NCBI (E. coli, Human Chr22), UniProt, ClinVar, ENCODE, Ensembl GFF3
  • Sizes: 30 KB to 51 MB per file

Notes

  • K-mers: BioLang uses canonical (strand-agnostic) 21-mers; Python uses forward-only. BioLang does strictly more work.
  • Python wins: VCF/CSV/GFF parsing and pipeline orchestration use Python's highly optimized C extensions (regex, csv, dict).
  • Windows: process creation costs tens of milliseconds more than Linux, which still shows in the smallest tasks — a 30 kB FASTA parse is 13x here against 76x on Linux, because BioLang’s own startup grows from 2 ms to 23 ms.

Correctness Validation

Two validation suites — synthetic and real-world — cross-validate 9 tasks against Python (BioPython) and R (Bioconductor) to ensure BioLang produces identical or numerically equivalent results.

Generated test data — controlled inputs for deterministic output comparison

Task Validated Against Tolerance
GC ContentPython, RFloat ±1e-6
K-mer CountingPythonExact integer
VCF FilteringPython, RExact integer
Reverse ComplementPython, RExact string
TranslatePython, RExact string
CSV Group-byPython, RFloat ±1e-6
GFF FeaturesPython, RExact integer
Sequence StatsPython, RFloat ±1e-6
BED IntervalsPython, RExact integer

How it works

Each validated task outputs JSON from all three languages. A recursive diff compares the outputs field-by-field, applying the specified tolerance for floating-point values and exact comparison for integers and strings.

Validation scripts and real-world data download tool live in the benchmarks/correctness/ directory of the repository.

Reproduce the Benchmarks

Clone the repo and run the benchmark suite yourself.

# Clone and enter the benchmarks directory
$ git clone https://github.com/oriclabs/biolang.git
$ cd biolang/benchmarks
# Install BioLang (if not already)
$ cargo install --path ../crates/bl-cli
# Generate test data
$ python generate_data.py
# Run all benchmarks (Linux)
$ bash run_all.sh
# Run correctness validation (synthetic data)
$ bash correctness/validate.sh
# Run real-world validation (E. coli, yeast, ClinVar)
$ python correctness/download_real_data.py
$ bash correctness/validate_real.sh

Raw results, scripts, and per-task analysis available at github.com/oriclabs/biolang/tree/main/benchmarks

Want even faster?

These benchmarks use BioLang's tree-walking interpreter. The bytecode compiler and Cranelift JIT are under active development.