A repo for collaboratively building small benchmarks to compare languages. If you have a suggestion for improvement: PR! If you want to add a language: PR!
To run one of the benchmarks:
cd
into desired benchmark directory (EG$ cd loops
)- Compile by running
$ bash ../compile.sh
- Run via
$ bash ../run.sh
. You should see output something like:
$ bash ../run.sh
C = 0.77
Go = 2.07
Node = 0.79
Bun = 0.83
Deno = 1.13
PyPy = 1.61
Java = 0.64
$
- For good measure, execute
$ bash ../clean.sh
when finished.
The numbers represent the real execution time (wall-clock time) it took for each language to execute the given task. A lower number indicates better performance.
bash ../run.sh
runs each program three times using the runOnce
function and awk
captures the real execution time.
To add a language:
- Select the benchmark directory you want to add to (EG
$ cd loops
) - Create a new subdirectory for the language (EG
$ mkdir rust
) - Implement the code in the appropriately named file (EG:
code.rs
) - If the language is compiled, add appropriate command to
../compile.sh
and../clean.sh
- Add appropriate line to
../run.sh
You are also welcome to add new top-level benchmarks dirs
Emphasizes loop, conditional, and basic math performance.
Emphasizes function call overhead and recursion.