Benchmarks
Each benchmark is one task, solved over and over in different languages. Programs are ranked by speed, and each carries a score for how idiomatic it is — so a fast but contorted program cannot push a clean, nearly-as-fast one off the page.
- Hello World 0 programs
- Write “Hello, world!” and exit. Every other benchmark subtracts this program’s time, so that startup does not count against heavy runtimes.
- Binary Trees 0 programs
- Allocate, walk and deallocate many perfect binary trees, while one long-lived tree stays alive throughout.
- Fannkuch-Redux 0 programs
- Count the pancake flips needed to bring 1 to the front of every permutation of 1…n, keeping a checksum.
- Fasta 0 programs
- Generate DNA sequences by copying from a given sequence and by weighted random selection with a simple linear congruential generator.
- K-Nucleotide 0 programs
- Count every k-nucleotide in a DNA sequence using the language’s own hash table, and report their frequencies.
- Mandelbrot 0 programs
- Plot the Mandelbrot set on an N-by-N bitmap and write it out in portable bitmap format.
- N-Body 0 programs
- Model the orbits of the Jovian planets with the same simple symplectic integrator.
- Partial Sums 0 programs
- Sum the first N terms of nine well-known series, using the same naïve double-precision loop.
- Pi Digits 0 programs
- Generate the digits of π with arbitrary-precision arithmetic and the step-by-step spigot algorithm.
- Regex-Redux 0 programs
- Match and replace a fixed set of regular expressions over DNA data, one pattern at a time.
- Reverse Complement 0 programs
- Read DNA sequences and write out the reverse complement of each.
- Spectral Norm 0 programs
- Calculate the spectral norm of an infinite matrix using the power method.