Comment

Comment by remi_forax

Hi guys, I'm the author of PHP.reboot and also one of the guys that worked on JSR 292 (invokedynamic in Java). First, I don't know based2 and please don't be too serious, PHP.reboot was written as a small prototype to see what can be done on top of invokedynamic. It was also used to debug the hotspot implementation of JSR 292.

The language is tailored unlike any dynamic languages. Instead of adding features and wondering how to optimize them after, I have worked backward and carefully pick/design features only if I was able to optimize it to be at least as fast as Java.

The hidden jewel of PHP.reboot is its runtime which first interpret the script and then use a type inference/type checker algorithm to try to emit exactly the same bytecode as javac. So some parts of the language are quite fast, but not the whole language because some parts still run in interpreted mode only.

As a demo, I've taken the mandelbrot benchmark from the Computer Language benchmark[1] and write it in PHP.reboot (I hope with no mistake). Here is the result on my laptop:

[forax@localhost phpreboot]$ time bin/phpr.sh test/mandelbrot.phpr >/dev/null

real 0m34.189s user 0m34.087s sys 0m0.088s

You can compare with your favourite dynamic language :)

cheers, Rémi

[1] http://shootout.alioth.debian.org/u64/performance.php?test=m...

parent remi_forax 15 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton