Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Scala vs Go vs Perl test
branch: master

This branch is 3 commits behind TJC:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


This project benchmarks the performance of Perl, Go and Scala with some
basic data processing from a CSV file.
It's not an amazingly-realistic task, but it's vaguely similar to some
of the real-world projects I do, and thus perhaps more comparable than
some of the totally synthetic benchmarks out there.

Read TASK to see what the specification is.

Use to create the source file, ie.
  ./ > input.csv

Then for each test, run it with the input file, and pipe the output
somewhere. For example:
  ./go/testread input.csv > output.csv
  (or pipe to /dev/null)

In my testing, I was using
Scala 2.8.0.RC1 on Java 1.6, w/
Perl 5.10.1 w/Text::CSV 1.17 and Text::CSV_XS 0.72
Go (May 2010 build)

I received the following results:
With a 100,000 row CSV file, they looked like:
Perl - 1.089 secs
Scala - 1.857 secs
Go - 1.682 secs

With a 1,000,000 row file:
Perl - 10.96 s
Scala - 9.835 s
Go - 16.77 s

With a 10,000,000 row file:
Perl - 111.3 s
Scala - 89.05 s
Go - 154.3 s

I am interested to receive (sensible) optimisations and improvements to the
code, and even implementations in other languages. (I'd love to see some in C,
C++, Ruby and Python, for starters. I'll probably do them myself, eventually.)

Something went wrong with that request. Please try again.