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 -Isrc5/lib -Cjava > ; javac ; 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 20 20 1000
real 5.9s
user 4.8s

# perl
time perl 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.