Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
C vs Scala vs Go vs Perl test http://blog.dryft.net/2010/05/new-res…
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 make_file.pl to create the source file, ie. ./make_file.pl > 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/OpenCSV.sf.net 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.)