This repository contains a (bash) script to measure the startup times of various scripting language interpreters and a (POSIX shell) script to plot the results with gnuplot.
Startup times are determined by starting every interpreter with an empty expression 30 times and then calculating the average.
results.txt contains the results for selected scripting languages as measured on my laptop (ASUS B9440UA, from 2017) with Arch Linux installed.
groovy: Groovy Version: 4.0.12 JVM: 1.8.0_372 Vendor: Oracle Corporation OS: Linux
xonsh: xonsh/0.14.0
fennel: Fennel 1.4.0 on PUC Lua 5.4
node: v20.2.0
ruby: ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c5) [x86_64-linux]
nu: 0.81.0
python: Python 3.11.3
php: PHP 8.2.7 (cli) (built: Jun 10 2023 08:47:39) (NTS)
rc: 2023-12-27
fish: fish, version 3.6.1
clisp: GNU CLISP 2.49.93+ (2018-02-18) (built on root2 [65.108.105.205])
bb: babashka v1.3.186
sbcl: SBCL 2.3.11
janet: 1.32.1-a93517f
zsh: zsh 5.9 (x86_64-pc-linux-gnu)
bash: GNU bash, Version 5.1.16(1)-release (x86_64-pc-linux-gnu)
yash: Yet another shell, version 2.52
perl: This is perl 5, version 36, subversion 1 (v5.36.1) built for x86_64-linux-thread-multi
lua: Lua 5.4.6 Copyright (C) 1994-2023 Lua.org, PUC-Rio
mrsh: 2022-09-14
oksh: oksh 7.2-1
luajit: LuaJIT 2.1.0-beta3 -- Copyright (C) 2005-2022 Mike Pall. https://luajit.org/
dash: dash 0.5.12-1
mksh: @(#)MIRBSD KSH R59 2023/06/03
ash: BusyBox v1.34.1 () multi-call binary.
- How fast an interpreter starts is only one of multiple factors if you want to compare the "speed" of scripting languages.
- This comparison is only about script execution, not about interactive mode.
- The loop (of 30 iterations) itself is contained in the average startup times.
That's why I have added a "no-operations" (
noop
) entry which does 30 times nothing. This takes on average 0.03 ms per iteration. Subtract this from all results for correct numbers. ash
is actuallybusybox ash
.- rc and mrsh are not yet finished/released. I have added them anyway.
- I don't use all of these languages. If any result is unexpected (maybe because of a bad configuration on my laptop), just send me an e-mail or create an issue.
- My locale is
de_DE.UTF-8
. When I setLC_ALL
toC
and run./measure-startup-times
again,zsh
,bash
andyash
run much faster.oksh
runs much slower. For all others I get similar results as before. - The included gnuplot script uses the Turbo colormap from the Gnuplotting/gnuplot-palettes repo. turbo.pal is not included in this repo because I'm not a license expert. Just clone/download it yourself.
If you want to reproduce these results, you should have all interpreters listed
above plus gnuplot
installed (and wget
or a browser for downloading
turbo.pal
).
./measure-startup-times all | tee results.txt
wget https://raw.githubusercontent.com/Gnuplotting/gnuplot-palettes/master/turbo.pal
# create the first three plots shown above
./create-plot all-plots
# create the fourth plot shown above
./create-plot -l -w all