Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Perl 6.0.0 is out - merry X-mas!

by Tux (Canon)
on Dec 28, 2015 at 12:18 UTC ( [id://1151254]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Perl 6.0.0 is out - merry X-mas!
in thread Perl 6.0.0 is out - merry X-mas!

Today it is (time in seconds needed to parse 10_000 lines of CSV with 5 fields each):

Perl5 0.016 Text::CSV::Easy_XS 0.016 Text::CSV::Easy_PP 0.033 Text::CSV_XS using bind_columns () 0.037 Text::CSV_XS 0.504 Text::CSV_PP (Text::CSV) 1.295 Pegex::CSV Perl6 17.474 Inline::Perl5 + Text::CSV_XS line-based 17.057 Inline::Perl5 + Text::CSV_XS IO-based 18.182 Inline::Perl5 + Text::CSV_PP (perl5's Text::CSV) 13.577 Text::CSV (perl6's Text::CSV) 49.948 CSV::Parser

There are plans to work on optimizing NativeCall soonish, so all timings using Inline::Perl5 might speed up because of that.

The timings for Text::CSV::Easy_?? are timing the use of a module that only parses 100% valid CSV. It offers no options to deal with abnormalities.

Given these numbers, we (the perl6 community) still need an overall performance gain of a factor 27 (13.6 → 0.5) to be able to say that pure-perl modules in perl6 are as fast as comparable pure-perl modules in perl5.

Personally I don't envision perl6 becoming as fast as perl5 with dedicated XS code, as Text::CSV_XS, at least not in the foreseeable future.


Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^4: Perl 6.0.0 is out - merry X-mas!
by Jenda (Abbot) on Jan 04, 2016 at 14:33 UTC

    So the quickest solution in Perl6 is only about 367 times slower than the "default" Perl5 solution. I guess I'd wait for a few more Christmases even if I actually liked the language.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

      Performance is not always the reason to choose a language. Esp in one-liners or scripts that take a small dataset, ease of use is way more important than the speed difference. If typing the one-liner takes longer than its runtime, you should not care.

      Perl6 offers a whole new toolkit, e.g. Text::CSV implements a whole legion of in/out combinations for the csv function.

      my Channel $ch = csv(in => "file.csv", out => Channel);

      And that makes it very easy to combine all kind of data generators and consumers, including support for types String, Array, Hash, Capture, Callable, Routine, Block, Supply, Channel. Sometimes it even makes sense to support both Channel:U (creates a new Channel on demand) and Channel:D (uses an existing Channel).

      my $aoh = csv(in => { $sth.fetch }, out => Hash);

      Readable and understandable. Explicit and intuitive. Something almost impossible in perl5 (or C, lua, go, java, php, and other languages).

      I 100% agree that speed is an essential property of a language, but unless the speed is needed (required), I think that perl6 is not only FUN to learn, but also gives you insight in new(er) possibilities and even new ides for existing perl5 modules. Perl6 makes it very easy to do things in parallel, where threading in perl5 makes users complain over and over and over again.

      Don't (yet) write off a language purely based on speed.


      Enjoy, Have FUN! H.Merijn
      What don't you like about it?
      if we code Perl 6 with OO, it should be slower ;)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1151254]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-19 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found