Just found that this rewriting bash/perl to python/ruby idea has a serious disadvantage:
only java is slower to start and a factor of 10-20 is significant.

This is basically benchmarking hello-world as a stand-in for more useful real-world one-liners.

here are the raw results of my benchmark of C, bash, perl, python, ruby, nodejs, java:

time ( for i in $(seq 1 1000) ; do busybox-static echo x ; done ) > /dev/null

real    0m2.953s
user    0m0.574s
sys     0m2.393s

time ( for i in $(seq 1 1000) ; do ./hello ; done ) > /dev/null

real    0m3.370s
user    0m0.686s
sys     0m2.556s

time ( for i in $(seq 1 1000) ; do busybox-static ash -c "echo x" ; done ) > /dev/null

real    0m3.543s
user    0m0.623s
sys     0m2.548s

time ( for i in $(seq 1 1000) ; do bash -c "echo x" ; done ) > /dev/null

real    0m7.930s
user    0m3.093s
sys     0m4.513s

time ( for i in $(seq 1 1000) ; do perl -e "print 'x'" ; done ) > /dev/null

real    0m8.257s
user    0m3.039s
sys     0m4.825s

time ( for i in $(seq 1 1000) ; do python -S -c "print 'x'" ; done ) > /dev/null

real    0m23.348s
user    0m14.937s
sys     0m7.569s

time ( for i in $(seq 1 1000) ; do ruby --disable-gems -e "puts 'x'" ; done ) > /dev/null

real    0m37.543s
user    0m28.122s
sys     0m9.156s

time ( for i in $(seq 1 1000) ; do python -c "print 'x'" ; done ) > /dev/null

real    1m6.999s
user    0m49.803s
sys     0m15.877s

time ( for i in $(seq 1 1000) ; do node -e 'console.log("Hello")' ; done ) > /dev/null

real    3m23.633s
user    2m57.923s
sys     0m24.670s

time ( for i in $(seq 1 1000) ; do ruby -e "puts 'x'" ; done ) > /dev/null

real    4m16.126s
user    3m37.540s
sys     0m25.116s

time ( for i in $(seq 1 1000) ; do java HelloWorld ; done ) > /dev/null

real    6m38.880s
user    6m46.950s
sys     0m58.413s
Shared publiclyView activity