Perl5 to Java compiler - first little script

For the first time, Perlito5-Java can now run an unmodified script - "rc-forest-fire" from the perl6-bench project.

I've experimented running the benchmark on the several Perlito5 platforms, and on perl itself:

# Perl5-in-Java - including compilation time
time ( touch Test.class ; rm Test.class ; perl perlito5.pl -Isrc5/lib -Cjava rc-forest-fire.pl > Test.java ; javac Test.java ; java Test 20 20 1000 )
real 6.9s
user 5.7s


# Perl5-in-Java - precompiled
time java Test 20 20 1000
real 5.7s
user 3.7s


# Perl5-in-JS - just-in-time compile
time node perlito5.js -Isrc5/lib rc-forest-fire.pl 20 20 1000
real 5.9s
user 4.8s


# perl
time perl rc-forest-fire.pl 20 20 1000
real 5.3s
user 1.1s

I've tested with javac 1.7.0_79, nodejs 0.10.25, perl 5.20.1 in Ubuntu.

There is a lot to optimize in the Java code generator, and Javascript could do a little better, too. But I'm very happy that the performance is not much worse in the first try!

Leave a comment

About Flávio S. Glock

user-pic I blog about Perl.