[Melbourne-pm] Still performing well..

Sam Watkins sam at nipl.net
Mon May 17 23:17:41 PDT 2010


On Tue, May 18, 2010 at 01:49:23PM +1000, Toby Corkindale wrote:
> After the last Perlmongers meeting I was curious to benchmark Perl vs Go  
> vs Scala in more than just a trivial case.
>
> I setup a test to read in a large CSV file, performing some minor  
> numeric and text manipulation upon each row, and outputing the results.
>
> I timed the results within the apps, so as to avoid the start-up time,  
> and will report both below.
>
>
> Language  :   Process time   : Total time
> Perl 5.10 :   1089 ms        : 1153 ms
> Go        :   1682 ms        : 1687 ms
> Scala 2.8 :   2729 ms        : 3114 ms

Text::CSV use C code (XS) by default, but I think Go should still be faster, 
as Text::CSV has to create all those perl data structures.  If you did it in
pure Perl (Text::CSV_PP) it would be a lot slower.  Perhaps Go is so much
slower than C, that the cost of setting up perl data structures doesn't matter.

Can you provide your benchmark code?  What did you use to the parse the CSV in
Go?  was it calling out to some Perl subroutines to do the work?  ;)

Sam



More information about the Melbourne-pm mailing list