Skip to content
ry

Benchmarks

Four suites compare ry’s runtime with GNU R. Two run code that others wrote: the programs that R compiler research measures itself on, and the test suites of CRAN packages. The other two run code we wrote: small numeric kernels, each also written in typed ry, and programs in the shape of package and business code. Each suite’s geometric mean of ry’s speed-ups over GNU R:

SuiteWhat it isry vs GNU Rry typed
Public R JIT benchmarks54 standard programs from R compiler research (Ř, rcp)2.90xnot typed
Package test suites26 pinned CRAN packages, each running its own test suite1.93xnot typed
Numeric kernels (ours)16 small programs we wrote whose time goes into loops, recursion and arithmetic on numbers5.26x11x
Application workloads (ours)15 programs we wrote in the shape of package and business code: calls, dispatch, conditions, records, tables1.84x2.35x

Geometric means of the speed-ups over GNU R; above 1x means ry is faster.

  • Public R JIT benchmarks: measured on 2026-11-11 at ry 4d96a342b with GNU R 4.6.2 on Intel(R) Xeon(R) Processor @ 2.30GHz, 4 cores, Linux 6.18.44-fc-v378; 10 paired rounds.
  • Package test suites: measured on 2026-11-11 at ry 46191c4 with GNU R 4.6.2 on Intel(R) Xeon(R) Processor @ 2.30GHz, 4 cores, Linux 6.18.44-fc-v378; 10 paired rounds.
  • Numeric kernels (ours): measured on 2026-11-11 at ry 4d96a342b with GNU R 4.6.2 on Intel(R) Xeon(R) Processor @ 2.30GHz, 4 cores, Linux 6.18.44-fc-v378; 10 paired rounds.
  • Application workloads (ours): measured on 2026-11-11 at ry 4d96a342b with GNU R 4.6.2 on Intel(R) Xeon(R) Processor @ 2.30GHz, 4 cores, Linux 6.18.44-fc-v378; 10 paired rounds.

Every number on this page is rendered from the results files in tools/bench/, and each chart names the date, the GNU R version, the machine and the ry commit of its measurement.

These are the programs that the Ř (rir) and rcp R compilers are measured on, from the suite of Kocourek, Křikava and Vitek, “Copy-and-Patch Just-in-Time Compiler for R” (VMIL 2025): all 57 but three that cannot be sized to a few seconds. They are vendored unchanged with their MIT licence, and each file ends with a driver that runs the program once at a fixed size and prints a checksum and its time. The sizes make GNU R 4.6 take about half a second to two seconds per program. Every run is a fresh process, so the time includes GNU R’s byte compilation and ry’s JIT tier-up, though not start-up.

Public R JIT benchmarks: Are We Fast Yet
Mandelbrot set, scalar loopsmandelbrotry: 2.88x
Tree allocationstoragery: 2.12x
Bouncing balls, named fieldsbouncery: 1.95x
Bouncing balls, positional fieldsbounce_nonameswide interval on ryry: 1.88x
Bouncing balls, positional fields, simple setupbounce_nonames_simplery: 1.82x

Speed relative to GNU R on a log scale: a bar to the right of 1x is faster than GNU R, to the left slower. The line across a bar spans its 95% interval. A program marked wide interval varied so much between rounds that its ratio's interval is wide; read its median with care.

Measured on 2026-11-11 at ry 4d96a342b with GNU R 4.6.2 on Intel(R) Xeon(R) Processor @ 2.30GHz, 4 cores, Linux 6.18.44-fc-v378; 10 paired rounds.

Public R JIT benchmarks: Benchmarks Game
Spectral normspectralnormtoo short on ryry: 14x
Spectral norm, scalar loopsspectralnorm_naivetoo short on rywide interval on ryry: 13x
Reverse complement, whole filereversecomplement_2ry: 5.97x
Reverse complementreversecomplementry: 4.95x
K-nucleotide, named vector countsknucleotide_brute_3ry: 4.28x
Reverse complement, scalar lookupreversecomplement_naivery: 3.85x
K-nucleotide, attribute countsknucleotide_brutery: 3.55x
Fasta, scalar linear searchfasta_naivewide interval on ryry: 3.50x
Fasta-reduxfastareduxwide interval on ryry: 3.28x
Spectral norm, matrix rebuilt per productspectralnorm_alt_2ry: 3.23x
Fasta-redux, scalar lookupfastaredux_naivewide interval on ryry: 3.10x
Fasta, vectorized binary searchfasta_3ry: 2.91x
K-nucleotide, attribute counts, growing vectorknucleotide_brute_2ry: 2.85x
Fasta, vectorized linear searchfasta_2ry: 2.61x
K-nucleotide, hashed environmentknucleotidery: 2.54x
Fannkuch-redux, scalar swapsfannkuchredux_naivery: 2.53x
Fastafastary: 2.48x
Fasta, scalar binary searchfasta_naive_2ry: 2.41x
Mandelbrot, scalar pointsmandelbrot_naive_asciiry: 2.23x
Regex DNAregexdnawide interval on ryry: 1.91x
N-body, matrix statenbody_2wide interval on ryry: 1.72x
Spectral norm, precomputed matrixspectralnorm_altry: 1.67x
Pi digitspidigitsry: 1.67x
Mandelbrot, vectorized rowsmandelbrot_asciiry: 1.55x
Mandelbrot, vectorized rows, no outputmandelbrot_nooutry: 1.45x
Spectral norm, eigenvaluesspectralnorm_mathry: 1.35x
N-bodynbodyry: 1.34x
Mandelbrot, whole-plane matrixmandelbrot_noout_naivery: 1.29x
Binary treesbinarytreesry: 1.20x
Binary trees, inline arithmeticbinarytrees_2ry: 1.11x
Binary trees, explicit loopbinarytrees_naivery: 1.09x
Fannkuch-reduxfannkuchreduxry: 1.03x
Spectral norm, element-wise matrix fillspectralnorm_alt_3ry: 1.02x

Speed relative to GNU R on a log scale: a bar to the right of 1x is faster than GNU R, to the left slower. The line across a bar spans its 95% interval. A time marked too short on a ry engine is under 0.1 s. That speed is what the suite measures, so it counts in the geometric mean. A program marked wide interval varied so much between rounds that its ratio's interval is wide; read its median with care.

Measured on 2026-11-11 at ry 4d96a342b with GNU R 4.6.2 on Intel(R) Xeon(R) Processor @ 2.30GHz, 4 cores, Linux 6.18.44-fc-v378; 10 paired rounds.

Public R JIT benchmarks: rcp micro-benchmarks and convolutions
Scalar assignment, while loopscalar-whiletoo short on rywide interval on ryry: 15x
Scalar assignment, for loopscalar-forry: 12x
Counting while loopempty-whiletoo short on ryry: 8.86x
Many local assignmentsbytecodestoo short on ryry: 6.97x
Convolution, scalar loopsconvolutionry: 5.91x
Vector element assignment, while loopvector-whilery: 5.68x
Superassignment loopsuper-whilery: 4.84x
Growing a list, for looplist-forwide interval on ryry: 4.49x
Growing a list, while looplist-whilewide interval on ryry: 4.40x
Convolution, [[ indexingconvolution_slowry: 4.25x
Vector element assignment, for loopvector-forry: 4.18x
Empty for loopempty-forry: 3.06x
lapply with an extra argumentlapply-dotsry: 2.54x
Matrix element assignmentmatrix-forwide interval on ryry: 2.43x
lapply with a closurelapplyry: 2.35x
Convolution, vectorizedconvolution_vry: 1.48x
geometric mean of all groupsry: 2.90x

Speed relative to GNU R on a log scale: a bar to the right of 1x is faster than GNU R, to the left slower. The line across a bar spans its 95% interval. A time marked too short on a ry engine is under 0.1 s. That speed is what the suite measures, so it counts in the geometric mean. A program marked wide interval varied so much between rounds that its ratio's interval is wide; read its median with care.

Measured on 2026-11-11 at ry 4d96a342b with GNU R 4.6.2 on Intel(R) Xeon(R) Processor @ 2.30GHz, 4 cores, Linux 6.18.44-fc-v378; 10 paired rounds.

Scalar loops gain the most, because the JIT compiles them to machine code while GNU R interprets bytecode. Programs that spend their time allocating gain the least.

The numbers: seconds and peak memory
programGNU Rryry, speed-up
Bouncing balls, named fields0.955 s0.463 s1.95x (1.80x to 2.10x)
Bouncing balls, positional fields0.773 s0.397 s1.88x (1.69x to 2.05x) (wide interval on ry)
Bouncing balls, positional fields, simple setup0.766 s0.406 s1.82x (1.75x to 1.95x)
Mandelbrot set, scalar loops0.866 s0.294 s2.88x (2.68x to 3.03x)
Tree allocation1.000 s0.471 s2.12x (2.05x to 2.28x)
Binary trees1.325 s1.091 s1.20x (1.10x to 1.27x)
Binary trees, inline arithmetic0.515 s0.480 s1.11x (1.04x to 1.22x)
Binary trees, explicit loop1.216 s1.113 s1.09x (1.01x to 1.15x)
Fannkuch-redux1.857 s1.875 s1.03x (0.94x to 1.08x)
Fannkuch-redux, scalar swaps1.017 s0.394 s2.53x (2.33x to 2.58x)
Fasta0.705 s0.277 s2.48x (2.31x to 2.59x)
Fasta, vectorized linear search0.750 s0.294 s2.61x (2.37x to 2.75x)
Fasta, vectorized binary search0.990 s0.347 s2.91x (2.62x to 3.16x)
Fasta, scalar linear search1.155 s0.325 s3.50x (3.04x to 3.67x) (wide interval on ry)
Fasta, scalar binary search1.542 s0.643 s2.41x (2.19x to 2.60x)
Fasta-redux0.915 s0.279 s3.28x (2.79x to 3.46x) (wide interval on ry)
Fasta-redux, scalar lookup1.117 s0.327 s3.10x (2.91x to 3.51x) (wide interval on ry)
K-nucleotide, hashed environment1.079 s0.419 s2.54x (2.42x to 2.69x)
K-nucleotide, attribute counts0.666 s0.183 s3.55x (3.39x to 3.76x)
K-nucleotide, attribute counts, growing vector1.095 s0.377 s2.85x (2.62x to 3.06x)
K-nucleotide, named vector counts0.872 s0.199 s4.28x (4.17x to 4.46x)
Mandelbrot, vectorized rows0.737 s0.460 s1.55x (1.43x to 1.68x)
Mandelbrot, scalar points1.169 s0.536 s2.23x (2.14x to 2.40x)
Mandelbrot, vectorized rows, no output0.601 s0.420 s1.45x (1.39x to 1.58x)
Mandelbrot, whole-plane matrix1.016 s0.783 s1.29x (1.25x to 1.34x)
N-body1.109 s0.817 s1.34x (1.21x to 1.39x)
N-body, matrix state1.177 s0.702 s1.72x (1.47x to 1.80x) (wide interval on ry)
Pi digits0.632 s0.403 s1.67x (1.52x to 1.73x)
Regex DNA0.743 s0.398 s1.91x (1.78x to 2.19x) (wide interval on ry)
Reverse complement0.626 s0.122 s4.95x (4.61x to 5.37x)
Reverse complement, whole file0.803 s0.135 s5.97x (5.48x to 6.55x)
Reverse complement, scalar lookup1.349 s0.350 s3.85x (3.62x to 4.06x)
Spectral norm0.974 s0.068 s14x (14x to 15x) (too short on ry)
Spectral norm, precomputed matrix1.516 s0.898 s1.67x (1.62x to 1.79x)
Spectral norm, matrix rebuilt per product1.885 s0.571 s3.23x (2.94x to 3.41x)
Spectral norm, element-wise matrix fill1.394 s1.371 s1.02x (0.97x to 1.04x)
Spectral norm, eigenvalues1.317 s1.051 s1.35x (1.24x to 1.37x)
Spectral norm, scalar loops0.996 s0.074 s13x (11x to 14x) (too short on ry, wide interval on ry)
Many local assignments0.493 s0.070 s6.97x (6.34x to 7.43x) (too short on ry)
Convolution, scalar loops0.755 s0.127 s5.91x (5.62x to 6.29x)
Convolution, [[ indexing0.831 s0.192 s4.25x (4.11x to 4.54x)
Convolution, vectorized1.361 s0.891 s1.48x (1.42x to 1.60x)
Empty for loop0.543 s0.172 s3.06x (2.96x to 3.32x)
Counting while loop0.474 s0.056 s8.86x (8.12x to 9.66x) (too short on ry)
lapply with a closure0.725 s0.314 s2.35x (2.19x to 2.56x)
lapply with an extra argument0.915 s0.351 s2.54x (2.37x to 2.68x)
Growing a list, for loop1.320 s0.285 s4.49x (3.99x to 4.90x) (wide interval on ry)
Growing a list, while loop1.173 s0.268 s4.40x (3.94x to 4.98x) (wide interval on ry)
Matrix element assignment0.495 s0.206 s2.43x (2.00x to 2.57x) (wide interval on ry)
Scalar assignment, for loop1.238 s0.107 s12x (11x to 12x)
Scalar assignment, while loop1.202 s0.072 s15x (13x to 17x) (too short on ry, wide interval on ry)
Superassignment loop1.004 s0.204 s4.84x (4.76x to 5.02x)
Vector element assignment, for loop0.916 s0.213 s4.18x (3.95x to 4.47x)
Vector element assignment, while loop0.942 s0.166 s5.68x (5.45x to 5.96x)

Each time is the median over the rounds. Each speed-up is the median of the per-round ratios, with its 95% interval in parentheses.

Measured on 2026-11-11 at ry 4d96a342b with GNU R 4.6.2 on Intel(R) Xeon(R) Processor @ 2.30GHz, 4 cores, Linux 6.18.44-fc-v378; 10 paired rounds.

Are We Fast Yet. R translations of programs from the Are We Fast Yet suite, which compares language implementations on the same small object and loop workloads. Bounce comes in three variants that differ in how a ball's fields are indexed. Source: github.com/PRL-PRG/r-compile-server/tree/b2b13a3150bddcc2d6dae8c37ecbbf1007170940/client/rsh/inst/benchmarks/areWeFast, MIT.

ProgramWhat it runsry vs GNU R
Bouncing balls, named fields
bounce
Moves 3,000 balls for 50 steps with lapply, reading and writing each ball's fields by name (ball['xVel'])1.95x
Bouncing balls, positional fields
bounce_nonames
Moves 10,000 balls for 50 steps with lapply, indexing each ball's fields by position and counting bounces through <<-1.88x
Bouncing balls, positional fields, simple setup
bounce_nonames_simple
Same as the positional variant, but each ball's four random numbers are drawn into locals before c() builds it1.82x
Mandelbrot set, scalar loops
mandelbrot
Computes a 450 x 450 Mandelbrot bitmap checksum with nested scalar while loops, double arithmetic and bitwShiftL/bitwXor2.88x
Tree allocation
storage
Recursively builds a depth-10 tree of 4-element lists with random leaves, stressing allocation, recursion and <<-2.12x

Benchmarks Game. R ports of the Computer Language Benchmarks Game programs, each in several variants that range from idiomatic vectorized R to naive scalar loops. The input-reading programs read a FASTA file that the driver generates with fasta.R before timing starts. Source: github.com/PRL-PRG/r-compile-server/tree/b2b13a3150bddcc2d6dae8c37ecbbf1007170940/client/rsh/inst/benchmarks/shootout, MIT.

ProgramWhat it runsry vs GNU R
Binary trees
binarytrees
Allocates and walks recursive list trees up to depth 12, with integer arithmetic and sapply over the iterations1.20x
Binary trees, inline arithmetic
binarytrees_2
Binary trees with the child items computed inline in the recursive call and double rather than integer depths1.11x
Binary trees, explicit loop
binarytrees_naive
Binary trees that sums each depth's checks in a for loop instead of sapply1.09x
Fannkuch-redux
fannkuchredux
Counts pancake flips over all permutations of 9 elements, reversing prefixes with vectorized rev and slice assignment1.03x
Fannkuch-redux, scalar swaps
fannkuchredux_naive
Fannkuch-redux that reverses prefixes and rotates the permutation one element at a time with [[ swaps2.53x
Fasta
fasta
Generates DNA sequences with an integer LCG, picking each line's codes at once with outer() and colSums2.48x
Fasta, vectorized linear search
fasta_2
Fasta that picks each line's codes by a vectorized linear search, advancing indices with which() until all match2.61x
Fasta, vectorized binary search
fasta_3
Fasta that picks each line's codes by a vectorized binary search over the cumulative probabilities2.91x
Fasta, scalar linear search
fasta_naive
Fasta that picks each character with a scalar linear search loop and joins every line with paste3.50x
Fasta, scalar binary search
fasta_naive_2
Fasta that picks each character with a scalar binary search loop and joins every line with paste2.41x
Fasta-redux
fastaredux
Fasta with a 4,096-entry lookup table that maps a random number to a code, corrected for a whole line at a time3.28x
Fasta-redux, scalar lookup
fastaredux_naive
Fasta-redux that does the table lookup and its correction one character at a time in a scalar loop3.10x
K-nucleotide, hashed environment
knucleotide
Reads a FASTA file and counts k-mer frequencies in a hashed environment with exists, get and assign2.54x
K-nucleotide, attribute counts
knucleotide_brute
K-nucleotide that keeps each k-mer's count as an attribute of an integer vector, read with attr and set with attr<-3.55x
K-nucleotide, attribute counts, growing vector
knucleotide_brute_2
Attribute-count k-nucleotide that also grows the underlying vector by doubling each time a new k-mer appears2.85x
K-nucleotide, named vector counts
knucleotide_brute_3
K-nucleotide that keeps the counts in a named integer vector, indexed and assigned by k-mer name4.28x
Mandelbrot, vectorized rows
mandelbrot_ascii
Iterates complex vectors one 1,300-point row at a time, packs the bits into raw bytes and prints them1.55x
Mandelbrot, scalar points
mandelbrot_naive_ascii
Iterates each point as a complex scalar with an escape test, packing bits into bytes one point at a time2.23x
Mandelbrot, vectorized rows, no output
mandelbrot_noout
The vectorized-row Mandelbrot without printing the bitmap, so the time is complex vector arithmetic1.45x
Mandelbrot, whole-plane matrix
mandelbrot_noout_naive
Iterates a 1,000 x 1,000 complex matrix 20 times, storing exp(-abs(Z)) into slices of a 3-D array1.29x
N-body
nbody
Simulates five planets with one coordinate vector per axis, using outer() and %*% at each of 40,000 steps1.34x
N-body, matrix state
nbody_2
N-body with positions in 3 x 5 matrices and pairwise distances filled into a 3-D array by nested loops, then aperm1.72x
Pi digits
pidigits
Prints 55 digits of pi with a spigot over a hand-written bignum on base-10,000 integer vectors1.67x
Regex DNA
regexdna
Counts nine DNA patterns with gregexpr and expands IUB codes with gsub over one large string1.91x
Reverse complement
reversecomplement
Reads a FASTA file line by line and maps each line's characters through a named vector in one vectorized lookup4.95x
Reverse complement, whole file
reversecomplement_2
Reverse complement that reads the whole file with one readLines call before mapping each line5.97x
Reverse complement, scalar lookup
reversecomplement_naive
Reverse complement that maps one character at a time with [[ on the named vector in a for loop3.85x
Spectral norm
spectralnorm
Multiplies by an 800 x 800 matrix once, filling each row with scalar closure calls and taking a %*% dot product14x
Spectral norm, precomputed matrix
spectralnorm_alt
Builds the 3,000 x 3,000 matrix once with outer() and runs 10 power iterations as matrix products1.67x
Spectral norm, matrix rebuilt per product
spectralnorm_alt_2
Spectral norm that rebuilds the 1,200 x 1,200 matrix with outer() for every matrix product3.23x
Spectral norm, element-wise matrix fill
spectralnorm_alt_3
Spectral norm that copies a precomputed table into a fresh matrix with [[i, j]]<- in nested loops for every product1.02x
Spectral norm, eigenvalues
spectralnorm_math
Computes the spectral norm directly as the largest eigenvalue of t(A) %*% A with eigen(), so LAPACK dominates1.35x
Spectral norm, scalar loops
spectralnorm_naive
Spectral norm with every matrix-vector product as nested scalar loops that call a closure per element13x

rcp micro-benchmarks and convolutions. The 13 micro-benchmarks of the simple/ directory, each one tight loop that isolates an interpreter cost such as variable assignment, vector subassignment or closure calls, and the 3 convolution programs of RealThing/, which compute the same convolution with scalar loops or vector operations. Source: github.com/PRL-PRG/r-compile-server/tree/b2b13a3150bddcc2d6dae8c37ecbbf1007170940/client/rsh/inst/benchmarks, MIT.

ProgramWhat it runsry vs GNU R
Many local assignments
bytecodes
A while loop that assigns the counter to 24 local variables per iteration, 500,000 times6.97x
Convolution, scalar loops
convolution
Convolves two 1,000-element vectors 10 times with nested for loops and [ indexing, as in Writing R Extensions5.91x
Convolution, [[ indexing
convolution_slow
Convolution with nested loops over seq(length =), [[ indexing and the outer element hoisted into a local4.25x
Convolution, vectorized
convolution_v
Convolves 1,500-element vectors with outer(), rbind, reshaping through length<- and dim<-, and rowSums1.48x
Empty for loop
empty-for
Runs a for loop with an empty body over 1:1e8, measuring pure loop overhead3.06x
Counting while loop
empty-while
Increments a double scalar in a while loop up to 2e78.86x
lapply with a closure
lapply
Calls a one-argument closure through lapply over 1e6 integers2.35x
lapply with an extra argument
lapply-dots
Calls a two-argument closure through lapply over 1e6 integers, passing the second argument through ...2.54x
Growing a list, for loop
list-for
Grows an empty list to 1.5e6 elements by [[<- in a for loop4.49x
Growing a list, while loop
list-while
Grows an empty list to 1.5e6 elements by [[<- in a while loop with a double index4.40x
Matrix element assignment
matrix-for
Assigns every element of a 3,000 x 3,000 matrix with [[i, j]]<- in nested for loops2.43x
Scalar assignment, for loop
scalar-for
Assigns the loop variable to a local in a for loop over 1:5e712x
Scalar assignment, while loop
scalar-while
Assigns and increments two double scalars in a while loop, 2.5e7 times15x
Superassignment loop
super-while
A closure increments a variable of its enclosing function with <<- in a while loop, 6e6 times4.84x
Vector element assignment, for loop
vector-for
Fills a 3e7-element vector by [[<- in a for loop, the first write coercing it from logical to integer4.18x
Vector element assignment, while loop
vector-while
Fills a 2e7-element integer vector by [[<- in a while loop with an integer counter, then sums it5.68x

This suite times the test suites of packages from ry’s benchmark dependency set. Each package and every dependency it installs is pinned by version and by the SHA-256 of its source tarball (tools/bench/packages/lock.tsv), so two machines measure the same code. GNU R installs them into one library that both engines load, because ry’s libR is ABI-compatible with GNU R’s. The tests run the way R CMD check runs them, offline. Each time is the wall time of a whole process, or for a package whose tests/ holds plain scripts, the sum over one process per script, so it includes start-up and loading the package and its imports, as real use does.

The suite also counts the tests that pass, fail and raise errors on each engine. A package whose counts differ between the engines is flagged, and a package whose tests do not run to the end on an engine is marked as failing there and has no speed-up.

Package test suites
abindry: 3.09x
progressry: 2.58x
R6ry: 2.58x
briory: 2.50x
DBIry: 2.43x
assertthatry: 2.42x
rappdirsry: 2.40x
cachemry: 2.35x
zoory: 2.34x
memoisery: 2.27x
zeallotwide interval on ryry: 2.26x
PerformanceAnalyticsry: 2.19x
withrtests differ on ry: GNU R: 355 passed, 0 failed, 0 errors; ry: 354 passed, 0 failed, 0 errorsry: 2.14x
lubridatery: 1.98x
lgrry: 1.81x
digestry: 1.78x
stringrry: 1.73x
rlangtests differ on ry: GNU R: 4010 passed, 0 failed, 0 errors; ry: 3995 passed, 0 failed, 12 errorsry: 1.73x
jsonlitery: 1.66x
purrrry: 1.57x
cliry: 1.54x
fsry: 1.53x
snakecasery: 1.44x
data.tabletests differ on ry: GNU R: 10 passed, 0 failed, 0 errors; ry: 9 passed, 1 failed, 0 errorsry: 1.35x
xtsry: 1.20x
foreachry: 1.08x
geometric meanry: 1.93x

Speed relative to GNU R on a log scale: a bar to the right of 1x is faster than GNU R, to the left slower. The line across a bar spans its 95% interval. A program marked wide interval varied so much between rounds that its ratio's interval is wide; read its median with care. A package marked tests differ passed a different number of tests on ry than on GNU R; the flag gives both counts.

Measured on 2026-11-11 at ry 46191c4 with GNU R 4.6.2 on Intel(R) Xeon(R) Processor @ 2.30GHz, 4 cores, Linux 6.18.44-fc-v378; 10 paired rounds.

The numbers: seconds, peak memory and test counts
programGNU Rryry, speed-up
abind 1.4-80.801 s0.257 s3.09x (2.92x to 3.29x)
assertthat 0.2.10.835 s0.341 s2.42x (2.24x to 2.66x)
brio 1.1.50.808 s0.333 s2.50x (2.25x to 2.72x)
cachem 1.1.00.905 s0.376 s2.35x (2.21x to 2.56x)
cli 3.6.625.939 s16.591 s1.54x (1.50x to 1.61x)
data.table 1.18.6.131.518 s23.861 s1.35x (1.23x to 1.37x) (tests differ on ry: GNU R: 10 passed, 0 failed, 0 errors; ry: 9 passed, 1 failed, 0 errors)
DBI 1.3.01.111 s0.436 s2.43x (2.25x to 2.56x)
digest 0.6.390.422 s0.233 s1.78x (1.62x to 1.92x)
foreach 1.5.211.560 s10.783 s1.08x (1.07x to 1.09x)
fs 2.1.010.215 s6.744 s1.53x (1.44x to 1.60x)
jsonlite 2.0.03.143 s1.865 s1.66x (1.56x to 1.74x)
lgr 0.5.25.936 s3.269 s1.81x (1.70x to 1.96x)
lubridate 1.9.515.470 s7.633 s1.98x (1.89x to 2.16x)
memoise 2.0.10.709 s0.311 s2.27x (2.18x to 2.36x)
PerformanceAnalytics 2.1.02.877 s1.198 s2.19x (2.10x to 2.29x)
progress 1.2.30.557 s0.213 s2.58x (2.50x to 2.82x)
purrr 1.2.213.544 s8.710 s1.57x (1.46x to 1.67x)
R6 2.6.13.724 s1.460 s2.58x (2.46x to 2.77x)
rappdirs 0.3.40.736 s0.303 s2.40x (2.18x to 2.51x)
rlang 1.3.064.120 s37.309 s1.73x (1.66x to 1.77x) (tests differ on ry: GNU R: 4010 passed, 0 failed, 0 errors; ry: 3995 passed, 0 failed, 12 errors)
snakecase 0.11.11.865 s1.240 s1.44x (1.33x to 1.58x)
stringr 1.6.03.913 s2.413 s1.73x (1.57x to 1.79x)
withr 3.0.32.661 s1.244 s2.14x (1.99x to 2.29x) (tests differ on ry: GNU R: 355 passed, 0 failed, 0 errors; ry: 354 passed, 0 failed, 0 errors)
xts 0.14.34.495 s3.695 s1.20x (1.13x to 1.29x)
zeallot 0.2.00.657 s0.294 s2.26x (2.02x to 2.44x) (wide interval on ry)
zoo 1.9-11.813 s0.744 s2.34x (2.27x to 2.51x)

Each time is the median over the rounds. Each speed-up is the median of the per-round ratios, with its 95% interval in parentheses.

Measured on 2026-11-11 at ry 46191c4 with GNU R 4.6.2 on Intel(R) Xeon(R) Processor @ 2.30GHz, 4 cores, Linux 6.18.44-fc-v378; 10 paired rounds.

ProgramWhat it runsry vs GNU R
abind 1.4-8
abind
Combines multidimensional arrays, with scripts that check dimnames and array slicing output3.09x
assertthat 0.2.1
assertthat
Easy pre and post assertions, tested through many small predicate calls2.42x
brio 1.1.5
brio
Basic R input and output, with tests that read and write files through C code2.50x
cachem 1.1.0
cachem
Caches R objects with automatic pruning, in memory and on disk2.35x
cli 3.6.6
cli
Helpers for command line interfaces, with snapshot tests of styled and formatted text1.54x
data.table 1.18.6.1
data.table
Extension of data.frame, with a large script suite of table operations backed by C code1.35x
DBI 1.3.0
DBI
The R database interface, a set of S4 generics, with tests of SQL quoting, interpolation and a dummy driver2.43x
digest 0.6.39
digest
Compact hash digests of R objects, with tests that compare many hash algorithms against known values1.78x
foreach 1.5.2
foreach
The foreach looping construct, with tests of iterators, result combiners, nesting and error handling1.08x
fs 2.1.0
fs
Cross-platform file system operations based on libuv, with tests that create and inspect real files1.53x
jsonlite 2.0.0
jsonlite
A JSON parser and generator, with round-trip tests over many R data types1.66x
lgr 0.5.2
lgr
A logging framework built on R6 classes, with appenders, layouts and filters1.81x
lubridate 1.9.5
lubridate
Date and time handling, with tests of parsing, time zones and period arithmetic1.98x
memoise 2.0.1
memoise
Memoisation of functions, with tests of in-memory and file system caches2.27x
PerformanceAnalytics 2.1.0
PerformanceAnalytics
Econometric tools for performance and risk analysis of xts return series2.19x
progress 1.2.3
progress
Terminal progress bars, with tests of their rendering from R and from C++2.58x
purrr 1.2.2
purrr
Functional programming tools, with tests of map functions and their error handling built on rlang and vctrs1.57x
R6 2.6.1
R6
Encapsulated classes with reference semantics, with tests of inheritance, cloning and active bindings2.58x
rappdirs 0.3.4
rappdirs
Determines where to save data, caches and logs, with tests over platform and environment variables2.40x
rlang 1.3.0
rlang
Functions for base types and core R features, with a large suite of tests on environments, quosures and conditions1.73x
snakecase 0.11.1
snakecase
Converts strings into any case, with tests that run many string transformations1.44x
stringr 1.6.0
stringr
Consistent wrappers for common string operations, built on stringi1.73x
withr 3.0.3
withr
Runs code with temporarily modified global state, with tests of options, environment variables and on.exit handlers2.14x
xts 0.14.3
xts
Extensible time series built on zoo, with tests of merging, subsetting and periodicity1.20x
zeallot 0.2.0
zeallot
Multiple, unpacking and destructuring assignment with the %<-% operator2.26x
zoo 1.9-1
zoo
S3 infrastructure for regular and irregular time series, with scripts compared against saved output2.34x

These are small programs we wrote whose time goes into arithmetic on numbers and numeric vectors: recursion, scalar loops, element loops over vectors, whole-vector arithmetic and a few kernels from the finance and biostatistics code bases. A process runs each program once cold and then five times warm, and the median warm run is its time, so the time leaves out start-up, GNU R’s byte compilation and ry’s first tier-up. Most programs also exist in typed ry, as a <name>.typed.R beside the plain R, which runs in strict mode as the ry typed column. Every engine must print the same checksum as GNU R, or the runner refuses to store the results.

Numeric kernels (ours)
  • ry
  • ry typed
Recursive Fibonaccifibtoo short on rytoo short on ry typedwide interval on ryry: 83xry typed: 94x
Collatz chainsinteger_looptoo short on ryry: 13xry typed: n/a
Drawdown and volatilitydrawdowntoo short on rytoo short on ry typedwide interval on ry typedry: 9.37xry typed: 25x
Counted loop sumloop_sumtoo short on rytoo short on ry typedry: 7.71xry typed: 23x
Element maparray_maptoo short on rytoo short on ry typedry: 6.67xry typed: 26x
Scale and shiftvector_looptoo short on ryry: 5.82xry typed: n/a
Dot productarray_dottoo short on rytoo short on ry typedwide interval on ry typedry: 5.62xry typed: 38x
Counting filterarray_filtertoo short on rytoo short on ry typedry: 5.39xry typed: 13x
Element sumarray_sumtoo short on rytoo short on ry typedry: 5.20xry typed: 8.89x
Pairwise distancesnested_loopstoo short on ryry: 5.15xry typed: n/a
Closures and lapplyclosurestoo short on ry typedwide interval on ry typedry: 3.28xry typed: 152x
Path simulationsimulationry: 3.17xry typed: n/a
Vector arithmeticvector_arithtoo short on rytoo short on ry typedry: 2.82xry typed: 3.08x
Vasicek rate pathsvasicektyped code partly refused: `vasicek` runs in the interpreterry: 1.91xry typed: 2.17x
Jackknife estimatejackknifery: 1.87xry typed: n/a
Log-rank statisticlog_ranktyped code partly refused: `log_rank` runs in the interpreter; `count` runs in the interpreterry: 1.36xry typed: 0.05x
geometric meanry: 5.26xry typed: 11x

Speed relative to GNU R on a log scale: a bar to the right of 1x is faster than GNU R, to the left slower. The line across a bar spans its 95% interval. A time marked too short on a ry engine is under 0.1 s. That speed is what the suite measures, so it counts in the geometric mean. A program marked typed code partly refused has code the typed core refused, which runs in the interpreter instead; the flag gives the refusal. A program marked wide interval varied so much between rounds that its ratio's interval is wide; read its median with care.

Measured on 2026-11-11 at ry 4d96a342b with GNU R 4.6.2 on Intel(R) Xeon(R) Processor @ 2.30GHz, 4 cores, Linux 6.18.44-fc-v378; 10 paired rounds.

Recursion and scalar loops gain the most from the JIT. Kernels whose time goes into vector and statistical routines gain the least, because those routines run in C on GNU R too. Typed scalar loops and recursion gain more again, because a typed function in strict mode compiles to native code before its first call.

The numbers: seconds and peak memory
programGNU Rryry typedry, speed-upry typed, speed-up
Dot product0.155 s0.028 s0.004 s5.62x (5.30x to 5.77x) (too short on ry)38x (32x to 40x) (too short on ry typed, wide interval on ry typed)
Counting filter0.120 s0.022 s0.009 s5.39x (5.17x to 5.56x) (too short on ry)13x (12x to 13x) (too short on ry typed)
Element map0.193 s0.029 s0.008 s6.67x (6.53x to 6.80x) (too short on ry)26x (24x to 27x) (too short on ry typed)
Element sum0.400 s0.076 s0.045 s5.20x (5.05x to 5.38x) (too short on ry)8.89x (8.34x to 9.22x) (too short on ry typed)
Closures and lapply0.491 s0.150 s0.003 s3.28x (3.18x to 3.47x)152x (118x to 172x) (too short on ry typed, wide interval on ry typed)
Drawdown and volatility0.209 s0.023 s0.009 s9.37x (9.17x to 9.51x) (too short on ry)25x (22x to 27x) (too short on ry typed, wide interval on ry typed)
Recursive Fibonacci0.500 s0.006 s0.005 s83x (76x to 93x) (too short on ry, wide interval on ry)94x (91x to 102x) (too short on ry typed)
Collatz chains0.427 s0.033 sn/a13x (12x to 14x) (too short on ry)n/a
Jackknife estimate0.363 s0.188 sn/a1.87x (1.83x to 1.94x)n/a
Log-rank statistic0.262 s0.190 s5.000 s1.36x (1.30x to 1.49x)0.05x (0.05x to 0.06x) (typed code partly refused: `log_rank` runs in the interpreter; `count` runs in the interpreter)
Counted loop sum0.162 s0.021 s0.007 s7.71x (7.49x to 7.79x) (too short on ry)23x (22x to 24x) (too short on ry typed)
Pairwise distances0.134 s0.026 sn/a5.15x (5.08x to 5.42x) (too short on ry)n/a
Path simulation0.364 s0.121 sn/a3.17x (2.93x to 3.36x)n/a
Vasicek rate paths0.218 s0.120 s0.101 s1.91x (1.77x to 1.99x)2.17x (2.05x to 2.28x) (typed code partly refused: `vasicek` runs in the interpreter)
Vector arithmetic0.153 s0.053 s0.050 s2.82x (2.63x to 3.03x) (too short on ry)3.08x (2.94x to 3.37x) (too short on ry typed)
Scale and shift0.207 s0.037 sn/a5.82x (5.62x to 6.04x) (too short on ry)n/a

Each time is the median over the rounds. Each speed-up is the median of the per-round ratios, with its 95% interval in parentheses.

Measured on 2026-11-11 at ry 4d96a342b with GNU R 4.6.2 on Intel(R) Xeon(R) Processor @ 2.30GHz, 4 cores, Linux 6.18.44-fc-v378; 10 paired rounds.

Each program as plain R and, where it exists, typed. The number beside the name is ry’s speed-up on the plain R.

Dot product array_dot 5.62x

An element loop over a million doubles summing `x[[i]] * y[[i]]`, five times: scalar indexing and arithmetic. Source

array_dot <- function(x, y, times) {
total <- 0
n <- length(x)
for (k in seq_len(times)) {
for (i in seq_len(n)) total <- total + x[[i]] * y[[i]]
}
total
}
x <- seq(0, 1, length.out = 1000000L)
y <- rev(x)
measure("array_dot", function() array_dot(x, y, 5L))
Counting filter array_filter 5.39x

An element loop over a million doubles counting those above one half: indexing and comparison in a loop. Source

array_filter <- function(x, y, times) {
total <- 0
n <- length(x)
for (k in seq_len(times)) {
for (i in seq_len(n)) if (x[[i]] > 0.5) total <- total + 1
}
total
}
x <- seq(0, 1, length.out = 1000000L)
y <- rev(x)
measure("array_filter", function() array_filter(x, y, 5L))
Element map array_map 6.67x

An element loop writing `x[[i]] * 2 + 1` into a preallocated vector of a million doubles: subassignment in a loop. Source

array_map <- function(x, y, times) {
total <- 0
n <- length(x)
out <- numeric(n)
for (k in seq_len(times)) {
for (i in seq_len(n)) out[[i]] <- x[[i]] * 2 + 1
total <- total + sum(out)
}
total
}
x <- seq(0, 1, length.out = 1000000L)
y <- rev(x)
measure("array_map", function() array_map(x, y, 5L))
Element sum array_sum 5.20x

An element loop summing a million doubles, twenty times: the cheapest indexed loop. Source

array_sum <- function(x, y, times) {
total <- 0
n <- length(x)
for (k in seq_len(times)) {
for (i in seq_len(n)) total <- total + x[[i]]
}
total
}
x <- seq(0, 1, length.out = 1000000L)
y <- rev(x)
measure("array_sum", function() array_sum(x, y, 20L))
Closures and lapply closures 3.28x

Small closures called in a loop, then lapply and vapply over a sequence: closure calls and argument matching. Source

closures <- function(n) {
add <- function(a, b) a + b
scale <- 3
times_scale <- function(a) a * scale
s <- 0
for (i in 1:n) s <- add(s, times_scale(i))
squares <- lapply(seq_len(n), function(x) x * (x + 0.5))
halves <- vapply(seq_len(n), function(x) x / 2, numeric(1))
squared <- unlist(squares)
s + sum(squared) + sum(halves)
}
measure("closures", function() closures(300000L))
Drawdown and volatility drawdown 9.37x

Maximum drawdown and EWMA volatility in one pass over a return series: scalar state carried through a loop. Source

risk_report <- function(returns, lambda = 0.94) {
wealth <- 1
peak <- 1
worst <- 0
variance <- returns[1] * returns[1]
for (i in seq_along(returns)) {
r <- returns[i]
wealth <- wealth * (1 + r)
if (wealth > peak) peak <- wealth
drawdown <- (peak - wealth) / peak
if (drawdown > worst) worst <- drawdown
variance <- lambda * variance + (1 - lambda) * r * r
}
c(max_drawdown = worst, volatility = sqrt(variance * 252))
}
returns <- sin(seq_len(2000000L) * 0.37) * 0.01 + 0.0002
measure("drawdown", function() sum(risk_report(returns)))
Recursive Fibonacci fib 83x

fib(30), about 2.7 million calls of a small recursive function: call overhead. Source

fib <- function(n) if (n < 2) n else fib(n - 1) + fib(n - 2)
measure("fib", function() fib(30))
Collatz chains integer_loop 13x

Collatz chain lengths up to 30,000 in nested while loops: integer arithmetic and branches. Source

Jackknife estimate jackknife 1.87x

A jackknife standard error through vapply and a closure that drops one element: vector copies per call. Source

Log-rank statistic log_rank 1.36x

The log-rank test statistic, a loop over event times with whole-vector comparisons in its body. Source

log_rank <- function(data) {
times <- sort(unique(data$time[data$event == 1L]))
observed <- 0
expected <- 0
variance <- 0
for (t in times) {
risk <- data$time >= t
n <- sum(risk)
n1 <- sum(risk & data$arm == "treated")
d <- sum(data$time == t & data$event == 1L)
d1 <- sum(data$time == t & data$event == 1L & data$arm == "treated")
observed <- observed + d1
expected <- expected + d * n1 / n
if (n > 1) variance <- variance + d * (n1 / n) * (1 - n1 / n) * (n - d) / (n - 1)
}
(observed - expected)^2 / variance
}
subjects <- 16000L
data <- list(
time = (seq_len(subjects) * 7919L) %% 1000L + 1L,
event = as.integer(seq_len(subjects) %% 3L != 0L),
arm = ifelse(seq_len(subjects) %% 2L == 0L, "treated", "control")
)
measure("log_rank", function() log_rank(data))
Counted loop sum loop_sum 7.71x

A scalar double accumulator in a counted loop of ten million steps: the bare loop. Source

loop_sum <- function(n) {
s <- 0
for (i in 1:n) s <- s + i * 0.5
s
}
measure("loop_sum", function() loop_sum(10000000L))
Pairwise distances nested_loops 5.15x

An O(n^2) pairwise distance sum in two nested loops: scalar indexing in an inner loop. Source

Path simulation simulation 3.17x

Simulated price paths with matrix products, apply over rows, quantiles and sorting: vectorized model code. Source

Vasicek rate paths vasicek 1.91x

Vasicek interest-rate paths, one matrix row per step: vector arithmetic and matrix subassignment. Source

vasicek_paths <- function(paths = 200L, steps = 20000L, r0 = 0.03, kappa = 0.5, theta = 0.04, sigma = 0.01, dt = 1 / 12, seed = 9L) {
set.seed(seed)
rates <- matrix(r0, nrow = steps + 1L, ncol = paths)
for (t in seq_len(steps)) {
shock <- stats::rnorm(paths)
previous <- rates[t, ]
rates[t + 1L, ] <- previous + kappa * (theta - previous) * dt + sigma * sqrt(dt) * shock
}
rates
}
measure("vasicek", function() sum(vasicek_paths()))
Vector arithmetic vector_arith 2.82x

Whole-vector arithmetic on a million doubles, repeated in a loop: allocation of large temporaries. Source

vector_arith <- function(x, times) {
total <- 0
for (k in seq_len(times)) {
y <- x * 2 + x / 3 - 1
total <- total + sum(y)
}
total
}
x <- seq(0, 1, length.out = 1000000L)
measure("vector_arith", function() vector_arith(x, 20L))
Scale and shift vector_loop 5.82x

Element-wise reads and writes of a double vector in a loop: `y[i] <- x[i] * 2 + 1`. Source

Every program reports its time through harness.R, which also prints the checksum that all engines must agree on.

These are programs we wrote in the shape of the code that packages and analyses run: validation at API boundaries, condition handling, S3, S4 and R6 objects, records as named lists, string building, data frames and data.table, time series and a testthat suite. Their time goes into R’s object and data machinery rather than into arithmetic. They are measured like the kernels, and six of them also exist in typed ry.

Application workloads (ours)
  • ry
  • ry typed
testthat suitetestthatwide interval on ryry: 3.38xry typed: n/a
Argument validationvalidationry: 2.81xry typed: n/a
Records as listsrecordsry: 2.24xry typed: n/a
String handlingstringsry: 2.12xry typed: n/a
Sales table pipelinesalestoo short on rytoo short on ry typedwide interval on rytyped code partly refused: `pipeline` runs in the interpreterry: 2.04xry typed: 2.60x
Order invoicingorderstyped code partly refused: refusing `.ry_record`; no code for [I64]: a base function the typed core does not know; `price_orders` runs in the interpreter; refusing `.ry_tag`; `region_of` runs in the interpreter; `tax_rate` runs in the interpreterry: 1.85xry typed: 0.79x
Bond book pricingbond_booktoo short on ry typedwide interval on ryry: 1.83xry typed: 9.07x
Functional stylefunctionalwide interval on ryry: 1.78xry typed: n/a
Object systemsobjectsry: 1.77xry typed: n/a
Expression treeexpr_treewide interval on rytyped code partly refused: refusing `.ry_tag`; no code for [I64, I64]: a base function the typed core does not know; `build` runs in the interpreter; `evaluate` runs in the interpreterry: 1.76xry typed: 1.35x
Row validationteam_scoreswide interval on rywide interval on ry typedtyped code partly refused: no code for [Vector { item: Str, array: true }]: a mapped function that is not a local function; `team_scores` runs in the interpreter; refusing `Result.with_default`; no code for [Str]: a base function the typed core does not know; `score` runs in the interpreterry: 1.62xry typed: 2.18x
Report formattingreportwide interval on rywide interval on ry typedtyped code partly refused: refusing `.ry_text`; no code for [I64]: a base function the typed core does not know; `report` runs in the interpreter; `padded` runs in the interpreterry: 1.54xry typed: 3.07x
Time series and datestimeseriesry: 1.40xry typed: n/a
Condition handlingconditionsry: 1.28xry typed: n/a
Tablestablesry: 1.27xry typed: n/a
geometric meanry: 1.84xry typed: 2.35x

Speed relative to GNU R on a log scale: a bar to the right of 1x is faster than GNU R, to the left slower. The line across a bar spans its 95% interval. A time marked too short on a ry engine is under 0.1 s. That speed is what the suite measures, so it counts in the geometric mean. A program marked typed code partly refused has code the typed core refused, which runs in the interpreter instead; the flag gives the refusal. A program marked wide interval varied so much between rounds that its ratio's interval is wide; read its median with care.

Measured on 2026-11-11 at ry 4d96a342b with GNU R 4.6.2 on Intel(R) Xeon(R) Processor @ 2.30GHz, 4 cores, Linux 6.18.44-fc-v378; 10 paired rounds.

These programs gain less than the kernels, because call setup, method dispatch, condition handling and complex assignment decide their time, not loops the JIT compiles. Typing gains the most where the typed core compiles the whole program. Where it refuses part of a program, that part runs in the interpreter, and the flag under the bar names what was refused.

The numbers: seconds and peak memory
programGNU Rryry typedry, speed-upry typed, speed-up
Bond book pricing0.433 s0.228 s0.046 s1.83x (1.69x to 2.01x) (wide interval on ry)9.07x (8.30x to 9.64x) (too short on ry typed)
Condition handling0.441 s0.336 sn/a1.28x (1.16x to 1.32x)n/a
Expression tree0.274 s0.157 s0.203 s1.76x (1.55x to 1.84x) (wide interval on ry)1.35x (1.26x to 1.47x) (typed code partly refused: refusing `.ry_tag`; no code for [I64, I64]: a base function the typed core does not know; `build` runs in the interpreter; `evaluate` runs in the interpreter)
Functional style0.496 s0.269 sn/a1.78x (1.70x to 1.96x) (wide interval on ry)n/a
Object systems0.581 s0.329 sn/a1.77x (1.67x to 1.93x)n/a
Order invoicing0.371 s0.199 s0.467 s1.85x (1.81x to 2.00x)0.79x (0.75x to 0.83x) (typed code partly refused: refusing `.ry_record`; no code for [I64]: a base function the typed core does not know; `price_orders` runs in the interpreter; refusing `.ry_tag`; `region_of` runs in the interpreter; `tax_rate` runs in the interpreter)
Records as lists0.407 s0.185 sn/a2.24x (2.03x to 2.28x)n/a
Report formatting0.433 s0.280 s0.140 s1.54x (1.36x to 1.74x) (wide interval on ry)3.07x (2.72x to 3.47x) (wide interval on ry typed, typed code partly refused: refusing `.ry_text`; no code for [I64]: a base function the typed core does not know; `report` runs in the interpreter; `padded` runs in the interpreter)
Sales table pipeline0.105 s0.052 s0.040 s2.04x (1.82x to 2.16x) (too short on ry, wide interval on ry)2.60x (2.50x to 2.79x) (too short on ry typed, typed code partly refused: `pipeline` runs in the interpreter)
String handling0.642 s0.300 sn/a2.12x (1.99x to 2.21x)n/a
Tables0.287 s0.234 sn/a1.27x (1.18x to 1.36x)n/a
Row validation0.674 s0.399 s0.315 s1.62x (1.51x to 1.81x) (wide interval on ry)2.18x (1.89x to 2.35x) (wide interval on ry typed, typed code partly refused: no code for [Vector { item: Str, array: true }]: a mapped function that is not a local function; `team_scores` runs in the interpreter; refusing `Result.with_default`; no code for [Str]: a base function the typed core does not know; `score` runs in the interpreter)
testthat suite0.529 s0.150 sn/a3.38x (2.93x to 3.58x) (wide interval on ry)n/a
Time series and dates0.933 s0.668 sn/a1.40x (1.33x to 1.44x)n/a
Argument validation0.548 s0.195 sn/a2.81x (2.58x to 2.92x)n/a

Each time is the median over the rounds. Each speed-up is the median of the per-round ratios, with its 95% interval in parentheses.

Measured on 2026-11-11 at ry 4d96a342b with GNU R 4.6.2 on Intel(R) Xeon(R) Processor @ 2.30GHz, 4 cores, Linux 6.18.44-fc-v378; 10 paired rounds.

Bond book pricing bond_book 1.83x

Prices 200,000 bonds, each a short vector computation through seq_len, rep, exp and sum: many small base calls. Source

bond_price <- function(coupon, rate, years) {
times <- seq_len(years)
flows <- rep(coupon, years)
flows[[years]] <- flows[[years]] + 100
sum(flows * exp(-rate * times))
}
price_book <- function(n) {
total <- 0
for (i in seq_len(n)) {
total <- total + bond_price(2 + i %% 5L, 0.01 + (i %% 7L) * 0.003, 5L + i %% 20L)
}
round(total, 6)
}
measure("bond_book", function() price_book(200000L))
Condition handling conditions 1.28x

tryCatch, withCallingHandlers, custom condition classes, retries and on.exit around fallible steps. Source

Expression tree expr_tree 1.76x

Builds and evaluates a tree of sums, maxima and negations: recursion over nested lists. Source

build <- function(depth, seed) {
if (depth == 0L) return(list(kind = "num", value = seed %% 10L + 1))
left <- build(depth - 1L, (seed * 7L) %% 1009L + 1L)
if (seed %% 5L == 0L) return(list(kind = "neg", inner = left))
right <- build(depth - 1L, (seed * 13L) %% 1013L + 3L)
if (seed %% 2L == 0L) list(kind = "add", left = left, right = right) else list(kind = "max", left = left, right = right)
}
evaluate <- function(node) {
switch(node$kind,
num = node$value,
neg = -evaluate(node$inner),
add = evaluate(node$left) + evaluate(node$right),
max = max(evaluate(node$left), evaluate(node$right))
)
}
tree <- build(21L, 5L)
measure("expr_tree", function() evaluate(tree) + evaluate(build(14L, 8L)))
Functional style functional 1.78x

lapply, Map, Filter, Reduce, do.call and purrr over lists, function factories and memoization in an environment. Source

Object systems objects 1.77x

S3 methods with UseMethod and NextMethod, S4 classes with validity, R6 classes with active bindings. Source

Order invoicing orders 1.85x

Prices order lines with a loyalty discount and regional tax, then totals invoices: records and branches. Source

price_line <- function(order, rates) {
net <- order$quantity * order$unit
if (order$loyal) net <- net * 0.95
if (order$quantity > 5L) net <- net - 1
tax <- net * rates[[order$region]]
list(id = order$id, net = net, tax = tax, gross = net + tax)
}
price_orders <- function(n) {
regions <- c("north", "south", "east", "west")
rates <- c(north = 0.2, south = 0.1, east = 0.15, west = 0.05)
total <- 0
for (i in seq_len(n)) {
order <- list(id = i, quantity = i %% 7L + 1L, unit = 10 + (i %% 13L) * 0.5, loyal = i %% 3L == 0L, region = regions[[i %% 4L + 1L]])
invoice <- price_line(order, rates)
total <- total + invoice$gross
}
total
}
measure("orders", function() price_orders(200000L))
Records as lists records 2.24x

Named lists grown, updated with `$<-` and `[[<-`, merged with modifyList, grouped with split and bound with rbind. Source

Report formatting report 1.54x

Formats one line per account, then joins and measures the report: string building. Source

report <- function(n) {
lines <- character(n)
for (i in seq_len(n)) {
name <- paste0("ACC", formatC(i, width = 6L, flag = "0"))
side <- if (i %% 2L == 0L) "long" else "short"
lines[[i]] <- paste(name, sprintf("%.2f", i * 1.25), side, sep = ";")
}
text <- paste(lines, collapse = "\n")
nchar(text) + sum(nchar(toupper(lines)) > 25L) + sum(startsWith(lines, "ACC00"))
}
measure("report", function() report(20000L))
Sales table pipeline sales 2.04x

Filters a million sales rows, adds a revenue column and totals it per region: data frame indexing and tapply. Source

pipeline <- function(sales) {
big <- sales[sales$units > 3L, ]
big$revenue <- big$units * big$price
totals <- tapply(big$revenue, big$region, sum)
sum(totals * seq_along(totals))
}
i <- seq_len(1000000L)
sales <- data.frame(region = c("north", "south", "east", "west")[i %% 4L + 1L], units = i %% 17L, price = 1 + i %% 100L)
measure("sales", function() pipeline(sales))
String handling strings 2.12x

paste, sprintf, gsub, regmatches, splitting and padding, and the same through stringr. Source

Tables tables 1.27x

data.table grouping, `:=` updates, keyed joins and rbindlist, and the same steps on base data frames. Source

Row validation team_scores 1.62x

Parses comma-separated rows, rejects invalid ones and totals scores per team: strsplit, conversion and failures as values. Source

parse_row <- function(row) {
parts <- strsplit(row, ",", fixed = TRUE)[[1L]]
age <- suppressWarnings(as.integer(parts[[2L]]))
if (is.na(age)) return(list(ok = FALSE, error = "bad_age"))
if (age < 18L) return(list(ok = FALSE, error = "minor"))
list(ok = TRUE, value = list(name = parts[[1L]], age = age, score = as.double(parts[[3L]]), team = parts[[4L]]))
}
team_scores <- function(rows) {
parsed <- lapply(rows, parse_row)
totals <- list()
errors <- 0L
for (p in parsed) {
if (p$ok) {
team <- p$value$team
old <- totals[[team]]
totals[[team]] <- (if (is.null(old)) 0 else old) + p$value$score
} else {
errors <- errors + 1L
}
}
totals[["red"]] + 2 * totals[["blue"]] + 3 * totals[["green"]] + errors
}
i <- seq_len(60000L)
rows <- paste0("user", i, ",", ifelse(i %% 17L == 0L, "x", as.character(i %% 90L)), ",", (i %% 50L) / 2, ",", c("red", "blue", "green")[i %% 3L + 1L])
measure("team_scores", function() team_scores(rows))
testthat suite testthat 3.38x

Many small test_that() blocks with expect_equal, expect_error and expect_warning: testthat's condition machinery. Source

Time series and dates timeseries 1.40x

xts and zoo series merged, lagged and rolled, lubridate parsing and month arithmetic, base Date sequences. Source

Argument validation validation 2.81x

Small functions with defaults, `...` forwarding, match.arg, stopifnot, missing() and match.call(). Source

Every program reports its time through harness.R, which also prints the checksum that all engines must agree on.

A run measures several rounds. Each round runs every program on every engine once, with the programs in an order shuffled per round and the engines in an order shuffled per program, from a recorded seed. Each ratio is formed inside one round, GNU R’s time over the engine’s, and the reported speed-up is the median of those per-round ratios. Pairing matters because the measuring machines are shared cloud VMs whose effective CPU speed drifts with other tenants’ load: a slow drift moves both engines of one round together, so it cancels in the ratio. Each speed-up and each geometric mean carries a 95% bootstrap interval over the rounds.

What one timed run covers differs by suite:

Suite One process runs The time includes
Public R JIT benchmarks the program once byte compilation and JIT tier-up, not start-up
Package test suites the package’s tests start-up and loading the package and its imports
Numeric kernels, application workloads the program once cold, then five times warm the median warm run only

The runner, not this page, judges the data:

  • Checksums. Every engine must print the same checksum as GNU R for a program, or the run fails and nothing is written. A numeric checksum may differ by a relative 1e-10, because a typed program may sum in a different order. A program that fails on any engine also fails the run.
  • Package tests. The packages suite is the exception, because there the program is the package’s own test suite. Test counts that differ between the engines are flagged as tests differ, and the package stays in the geometric mean. A test script that ends in an R error, as R CMD check reads a failing script, counts as one failed test. A test suite that crashes or does not run to the end on an engine is recorded as failing there, which leaves the package out of the geometric mean.
  • Too short. A program GNU R finishes in under 0.1 s does too little work for a stable ratio, so it is flagged too short and left out of every geometric mean. A ry time under 0.1 s is flagged too, but it counts, because that speed is what the suite measures.
  • Wide intervals. A ratio whose interval reaches more than 10% from its median gets extra rounds, and it is flagged wide interval if they do not narrow it.
  • Refused typed programs. Where the typed core refuses part of a typed program, that part runs in the interpreter, and its flag gives the refusal.
SuiteReproduceGNU REnginesSamples
Public R JIT benchmarksjust bench public --write4.6.2, BLAS libblas.so.3.12.0GNU R, ry10 paired rounds, 10 more for each wide interval, seed 1
Package test suitesjust bench packages --write4.6.2, BLAS libblas.so.3.12.0GNU R, ry10 paired rounds, 10 more for each wide interval, seed 1
Numeric kernels (ours)just bench kernels --write4.6.2, BLAS libblas.so.3.12.0GNU R, ry, ry typed10 paired rounds, 10 more for each wide interval, seed 1
Application workloads (ours)just bench applications --write4.6.2, BLAS libblas.so.3.12.0GNU R, ry, ry typed10 paired rounds, 10 more for each wide interval, seed 1

To reproduce a suite, run its command from the table on a machine with GNU R; the packages suite first needs just bench-packages install. With --write, the runner stores tools/bench/<suite>/results.json with the commit that built ry, and just readme rewrites the README summary from it. --write refuses a working tree with a change to a tracked file or an untracked file under crates/ or tools/bench/, so every stored commit reproduces its measurement. The README summary warns when the suites were measured on different machines (CPU model or kernel) or against a GNU R on a different BLAS, because their ratios are then not comparable.