Skip to content

Benchmark a bunch of programming languages by enumerating self avoiding random walks.

Notifications You must be signed in to change notification settings

originalsouth/saw_bench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

saw_bench

Benchmark a bunch of programming languages by enumerating self avoiding walks.

/* By BC van Zuiden -- Leiden, November 2016 */
/* Probably very buggy USE AT OWN RISK this will brick everything you own */
/* NOBODY but YOU is liable for anything that happened in result of using this */
/* WARNING: DON'T RUN THIS PROGRAM THIS WILL DESTROY YOUR COMPUTER AND/OR HOUSE */
/* Any copyrighted piece of code within this code is NOT mine */
/* Inclusion of that code is forced upon me by a scary anonymous guy with a gun*/
/* https://github.com/originalsouth/saw_bench */

Compares execution time for the same recursive algorithm for enumerating self avoiding walks implemented in a bunch of different programming languages (or compiler platforms).

Feel free to reuse and contribute, pull requests are very welcome! This code is (and forever will be) a work in progress.

Usage

Make sure make, Rust, gcc, clang, fortran90, Julia, python, gawk, php, nodejs, emscripten, elixir, lua and R are installed and just run:

make benchmark | sort -t: -k 2 -h

and you will see an ordered list of execution times (obviously less is faster).

Results

Running this on a Intel(R) Core(TM) M-5Y10c CPU @ 0.80GHz with an up to date 5.0.0-arch1-1-ARCH we find:

c (gcc): 6.26s
c++ (gcc): 6.55s
c (clang): 6.98s
c++ (clang): 7.11s
rust: 7.92s
fortran90 (gcc): 8.24s
emcc/js (node): 8.68s
julia (optimized): 9.44s
em++/js (node): 11.56s
node (js): 32.95s
julia: 216.54s
php: 244.90s
lua: 375.86s
awk (gawk): 732.79s
python: 862.74s
Rscript: 1898.63s
elixir: 2366.36s

About

Benchmark a bunch of programming languages by enumerating self avoiding random walks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published