News for hackers. Stuff that matters.
Re:Myths about Perl 6 by nxrabl on Sunday July 07, 2019 @08:56AM (#20374859)
I respect that Rakudo is still under development, but it's no myth that, as it is today, Perl 6 is pretty slow. I did some benchmarking [0] comparing the time for various interpreted languages to start up, print "Hello world", and quit (or to start up, read from /dev/null, and quit), and Rakudo was about twice as slow as Node and Ruby, and 100x slower than Perl 5. (I think this is a decent test of performance if what you mostly run are short scripts but I'm more than open to improvements.)

[0] https://github.com/wilt00/startuptime/blob/master/analysis.i...

Re:Myths about Perl 6 by Ultimatt on Sunday July 07, 2019 @09:40AM (#20375034)
$ time perl -E 'say "hello world"' hello world

real 0m0.016s user 0m0.005s sys 0m0.007s

$ time perl6 -e 'say "hello world"' hello world

real 0m0.187s user 0m0.226s sys 0m0.032s

That is not 100x slower, 10x sure. But once its running its faster than Perl 5 in plenty of situations especially for things like heavy OO use or compact numeric work in tight loops. Anyone who argues Perl 6 is fast is definitely being disingenuous but the counter is almost certainly more annoying to come across simply because "startup time" is only important if you expect your program to execute in less than a tenth of a second. So tight loops in a shell script for something simple, stick to Perl 5. Large web app that will be running for the next 5 years who cares about 10x slower startup time? Hardly a benchmark thats useful.

Re:Myths about Perl 6 by futureastronaut on Sunday July 07, 2019 @10:28AM (#20375226)
Agreed, "Perl 6 is slow" is a ridiculous takeaway from a benchmark of process start times.
Re:Myths about Perl 6 by lizmat on Sunday July 07, 2019 @10:31AM (#20375244)
Especially if you would compare a "Modern Perl 5" startup sequence, which would involve using the `Moose` module (as Perl 6 has that built in). Then startup times are basically the same.
Re:Myths about Perl 6 by microtherion on Sunday July 07, 2019 @11:29AM (#20375559)
So the argument against Perl 6 being slow is "if you use it properly, Perl 5 can be just as slow" ?
Re:Myths about Perl 6 by futureastronaut on Sunday July 07, 2019 @02:06PM (#20376601)
It's more like saying "the conventional P5 runtime is about as heavy as the distributed P6 one", seems fair to me.
Re:Myths about Perl 6 by keypusher on Sunday July 07, 2019 @10:48AM (#20375341)
Startup time is only relevant in specific cases, and doesn’t really reflect what most people think of as the language speed. It’s most important in serverless apps or similar cases where a small script is going to be called very frequently and the results are time critical, in most other cases it is very quickly made irrelevant by the duration of the task itself. For example, Java and C# start up slower than many interpreted languages, but can be significantly faster once they get going. I suggest a more accurate benchmark to be something that include some file io, string processing, arithmetic, and some basic data structure operations. I have an idea I might code up later.
Re:Myths about Perl 6 by nneonneo on Sunday July 07, 2019 @01:32PM (#20376327)
One of the key use-cases for Perl 5 in scripts was as a replacement for sed/grep/awk. In a makefile or batch processing script, these can get called hundreds to thousands of times per second effortlessly. With a startup time of .2s, you could only start a Perl 6 interpreter 5 times per second, which is a major slowdown and eliminates it from this class of use-cases.
Re:Myths about Perl 6 by ccashell on Sunday July 07, 2019 @09:24PM (#20379228)
If you're doing some sort of processing where you're calling an external script hundreds or thousands of times, you're probably doing it wrong. You should be writing it to get called once and process your input as it comes in.

That goes regardless of language. If you're calling an external "thing" thousands of times to process something, you're going to have issues with performance because the approach to processing the data is bad.

You can get away with it to a point by using only the most simple and basic of tools (cat/cut/tr/echo/grep/etc), but one of the common reasons that shell scripts get rewritten in Perl/Python/etc is to process data without making hundreds of thousands of calls to spawn external processes.