Scripting Languages – Profiling “Hello, world”

I’ve been trying different scripting languages out lately. I wanted to try using a Lisp-like scripting language where I would normally have used Python. But experiments with Racket disappointed me, it seems very slow to start. So I decided to benchmark how long it takes to display the famous “Hello, world” string and quit in various languages.

I even threw in SBCL and Clozure Common Lisp for comparison. Here’s a graph showing how they all did on my Macbook Pro:

As you can see, I was right to be disappointed with Racket. Even SBCL, which does high-quality native code compilation is more than 10 times faster. In my opinion, paying more than a few milliseconds to start executing a script is not acceptable on today’s hardware. Here are the full timings in a table for your browsing pleasure:

Ruby 0.011
Python 0.020
Racket 0.359
Perl 0.006
CLISP 0.014
SBCL 0.030
Clozure 0.031
Gambit 0.009
Advertisements

6 thoughts on “Scripting Languages – Profiling “Hello, world”

  1. How did you perform the Racket test?
    Nevertheless, it is difficult to measure performance of programming languages due to the unpredictability of JITers.

    • I basically ran “time racket hello.scm” as with all the other programming languages. The program is basically (display “Hello world”).

      It’s not very difficult measure at all, it’s just as slow to start every time 🙂

  2. Have you tried compiling the program first? I am very curious as to if the program takes the same if compiled? What do you think?

    • I tried that before and I saw maybe 100 ms improvement, I don’t have the exact numbers at hand. But if I have to compile my scripts, I might as well use C or Common Lisp.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s