News for hackers. Stuff that matters.
Re:A Review of Perl 6 by 23409125 on Sunday August 13, 2017 @05:15PM (#15004977)
Subpar performance is a huge drawback of Perl 6.

I usually don't program in Perl, but occasionally use it instead of sed.

Compare, Perl 5 vs. Perl 6:

    $ time yes | head -n1000000 | perl -pe 's/y/n/' >/dev/null

    real	0m0.945s
    user	0m0.944s
    sys	0m0.016s
    $ time yes | head -n1000000 | perl6 -pe 's/y/n/' >/dev/null

    real	2m49.881s
    user	2m44.892s
    sys	0m2.184s
Spending several minutes to do what can be done in under 1 second is just unacceptable.
Re:A Review of Perl 6 by artagnon on Monday August 14, 2017 @12:37AM (#15006591)
It's nice to dream up a language with the perfect semantics; in reality, all programming languages make compromises because they are limited by current compiler technology. Ruby is on one extreme end of the spectrum, making little compromises on beauty, but we all know how slow it is.

Go is on the other end of the spectrum; they have tuned their syntax to be fast to parse, and have stuck to implementing existing compiler technology. If your semantics are very far removed from how computers work, you need a very advanced compiler like GHC.

It sounds like Perl6 is somewhat centrist in its approach, and has innovated quite a bit; I think it will be possible to almost match Perl5's speed with reasonable effort. The interpreter might do well on small examples, but the VM will dominate in very large ones. Many compilers are tiered in that they use an interpreter for cold code, and spend the effort to generate code and JIT hot code.

Re:A Review of Perl 6 by zoffix222 on Sunday August 13, 2017 @05:22PM (#15005015)
Yes, performance is where most of the funding is currently going into.

Bleed commits on VM for example, recently passed Perl 5 on speed with read-a-million-line-file-and-sum-up-number-of-chars bench ( https://twitter.com/zoffix/status/895684203550973956 ).

Re:A Review of Perl 6 by 23409125 on Sunday August 13, 2017 @05:27PM (#15005034)
What are bleed commits?
Re:A Review of Perl 6 by jacobolus on Sunday August 13, 2017 @06:58PM (#15005453)
The “cutting edge” of technology or craft is the newest / greatest stuff, pushing the field forward in new unexplored directions, by analogy to the cutting edge of a plow or a knife which slices through some uncut material or unbroken ground. I believe the metaphorical use of the term dates from the middle of the 20th century.

The “bleeding edge” is a more recent term for the same idea, emphasizing that being at the cutting edge might involve danger to yourself.

Re:A Review of Perl 6 by zoffix222 on Sunday August 13, 2017 @05:32PM (#15005073)
Commits that happened recently and aren't part of any release yet :)
Re:A Review of Perl 6 by colejohnson66 on Sunday August 13, 2017 @06:53PM (#15005427)
Commits that would go into the bleeding edge builds
Re:A Review of Perl 6 by wott on Sunday August 13, 2017 @05:31PM (#15005059)
Yes, I haven't tried lately, but for my own small text manipulation program, Perl 6 was still more than 100 times slower than Perl 5 the last time I tried. Probably because of some JIT delaying the startup time. But since my use is calling small programs, it was a no go for me; and after one year it had not improved a bit.
Re:A Review of Perl 6 by visarga on Sunday August 13, 2017 @05:52PM (#15005158)
Many string and dictionary based operations seem to work faster in Perl5 than Python for me.
Re:A Review of Perl 6 by Steeeve on Monday August 14, 2017 @03:45AM (#15007162)
Perl5 string and hash performance was always top notch.
Re:A Review of Perl 6 by wott on Sunday August 13, 2017 @07:39PM (#15005626)
The Perl 5 version was indeed also 3 to 4 times faster than the Python one.
Re:A Review of Perl 6 by issaria on Monday August 14, 2017 @07:18AM (#15007879)
Did you compare to python2 or python3, cause python3 is in the same league as perl6.
Re:A Review of Perl 6 by logicallee on Monday August 14, 2017 @03:35AM (#15007123)
wow, that is insane. You picked an awesome example.

We're only talking about on the order of a million bytes in your example, so 2 minutes to process on the order of 1 megabyte with a regex is just insane. If you applied it to 1 gigabyte of files that would be an even 2 days vs Perl 5 @ 16 minutes.[1] Sixteen minutes isn't enough to rewrite it in C, so Perl 5 is "fast enough". You can go get a coffee or think about the next thing you want to do with the data, or write the next part of your processing. But two days is prohibitive: it breaks your workflow.

[1]

https://www.google.com/search?q=2+minutes+49+seconds*+1024

https://www.google.com/search?q=0.94+seconds+*+1024

Re:A Review of Perl 6 by throwaway7645 on Monday August 14, 2017 @07:46AM (#15007984)
It might help to point out that the core team only froze the spec during Christmas last year or year before and have therefore just started on performance in a way. If you check the perl6 weekly site you'll see significant progress on a weekly basis (ex: Lists sped up by 1500%).
Re:A Review of Perl 6 by ash_gti on Tuesday August 15, 2017 @12:14AM (#15015418)
So, a fairly simple change to this will bring down the time to a few ms (86 ms on my computer)

  time yes | head -n1000000 | perl6 -e 'for $*IN.readchars { .subst("y", "n").print }’
Its slightly more complicated because I’m having it read the input in a chunk instead of on a per-line basis and I’m using subst on a literal instead of a regex.
Re:A Review of Perl 6 by davemp on Monday August 14, 2017 @01:42PM (#15010676)
> \d now matches Unicode digits such as ᭕ (a Balinese five) and ๓ (a Thai three).

This sounds like a disaster waiting to happen.

Re:A Review of Perl 6 by perlancar3 on Tuesday August 15, 2017 @05:51AM (#15016775)
It has been like that since forever (at least since 5.10, 2007). To only match 0-9, use [0-9] or /\d/a (/a is available since 5.14, 2011).
Re:A Review of Perl 6 by ab5tract on Tuesday August 15, 2017 @06:45AM (#15016990)
How, exactly?
Re:A Review of Perl 6 by cestith on Monday August 14, 2017 @01:11PM (#15010378)
Perl 6 is a spec. The current Rakudo implementation is being focused toward sped now that the spec is stable.
Re:A Review of Perl 6 by gigatexal on Monday August 14, 2017 @12:46AM (#15006615)
did you file a bug? is there a way to trace the perl6 one and see where the hotspots are?
Re:A Review of Perl 6 by perlgeek on Monday August 14, 2017 @02:59AM (#15007001)
perl6 --profile yourprogram.p6
Re:A Review of Perl 6 by smegel on Sunday August 13, 2017 @07:33PM (#15005604)
It is a drawback of the current implementations of Perl 6, yes.