« Perl6-regex on Perl5-regex | Main | KindaPerl6 released on CPAN »

2007.08.26

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

The KindaPerl6 test has probably to be done this way:

time -p echo "say(42);" | perl kp6-perl5.pl | perl -Ilib

What you currently use is v6.pm, another Perl6-in-Perl5 implementation.

But I cannot exclude the possibility that it is me who is confused by the rich number of Perl6-alike implementations. :-)

Thanks for the tip. That method turned out to be the slowest of all:


$ time -p echo "say(42);" | perl kp6-perl5.pl | perl -Ilib
Can't locate package Value for @Pair::ISA at /usr/local/share/perl/5.8.8/Moose/Meta/Class.pm line 128.
Can't locate package Value for @Pair::ISA at /usr/local/share/perl/5.8.8/Moose/Meta/Class.pm line 128.
Can't locate package Value for @Pair::ISA at /usr/local/share/perl/5.8.8/Moose/Meta/Class.pm line 128.
Can't locate package Value for @Pair::ISA at /usr/local/share/perl/5.8.8/Moose/Meta/Class.pm line 128.
Can't locate package Value for @Capture::ISA at /usr/local/share/perl/5.8.8/Moose/Meta/Class.pm line 128.
Can't locate package Value for @Capture::ISA at /usr/local/share/perl/5.8.8/Moose/Meta/Class.pm line 128.
Can't locate package Value for @Capture::ISA at /usr/local/share/perl/5.8.8/Moose/Meta/Class.pm line 128.
Can't locate package Value for @Signature::ISA at /usr/local/share/perl/5.8.8/Moose/Meta/Class.pm line 128.
Can't locate package Value for @Signature::ISA at /usr/local/share/perl/5.8.8/Moose/Meta/Class.pm line 128.
Can't locate package Value for @Signature::ISA at /usr/local/share/perl/5.8.8/Moose/Meta/Class.pm line 128.
Can't locate package Code for @Multi::ISA at /usr/local/share/perl/5.8.8/Moose/Meta/Class.pm line 128.
Can't locate package Value for @IO::ISA at /usr/local/share/perl/5.8.8/Moose/Meta/Class.pm line 128.
42
real 7.17

You forgot a -Ilib:

time -p echo "say(42);" | perl kp6-perl5.pl | perl -Ilib5
42
real 0.33
user 0.30
sys 0.02

Mortiz, I had actually included in (it doesn't work at all without it), but I failed to paste it. Somehow, your result is much, much faster. Mine was on a laptop which currently believes it is 732Mhz (although it actually should be able to run faster).

please note that KindaPerl6 supports precompilation:

$ time -p echo "say(42);" | perl kp6-perl5.pl > test.pl
real 0.26
user 0.20
sys 0.04
$ time -p perl -Ilib5 test.pl
42
real 0.08
user 0.07
sys 0.01

fglock, Thanks for the comment. I noticed that the difference in your syntax was specifying "lib5"...not just "lib".

That makes a huge performance difference. :)

I have now updated the article to reflect that KindaPerl6 with pre-compilation is about as fast as NPQ.

Now that kp6 has a CL backend things are going quite a bit faster, at least under SBCL which compiles the resulting code to native machine code.

$ echo 'say 42' | perl kp6-mp6-perl5.pl --lisp > hello.lisp
* munge hello.lisp so that the main code is in a function called "Main"*
$ sbcl --load hello.lisp
* loads of output*
* (sb-ext:save-lisp-and-die "hello.exe" :toplevel (lambda () (Main::Main) 0) :executable t)

$ time ./hello.exe | grep 42
42

real 0m0.063s

$ time perl -I lib-kp6-mp6-p5 hello.pl
42

real 0m0.207s

The comments to this entry are closed.

December 2015

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

License