HN user

jkopczewski

29 karma
Posts0
Comments4
View on HN
No posts found.
FasterCGI with HHVM 13 years ago

As to the Fibonacci numbers: I don't have it but it would be something along the lines of:

function fib($n) { if ($n <= 1) { return $n; } else { return fib($n - 1) + fib($n - 2); } }

$n = 30; $r = fib($n); echo "Fibonacci number $n is $r\n";

As indicated in the benchmark, it's a dumb exponential implementation.

FasterCGI with HHVM 13 years ago

I used the php.ini file that comes bundled with the sources. I just think after I ran the benchmark the first time, I enabled opcode cache explicitly just to be sure. I used the Wordpress setup that comes in the sources. Followed the on-screen instructions. That's it.

I tried tweaking the nginx setup, especially the tcp_nodelay & keepalive_timeout settings. It provided maybe 15% speed up, nothing dramatic. I probably didn't collect enough datapoints to be able to reliably tell. In the end, I sticked to the nginx defaults.

FasterCGI with HHVM 13 years ago

The only other place where I could have possibly screwed up the results is compilation. I had to build PHP from source, since I wanted to have the "latest greatest" and CentOS has dated packages at times. Though again, I remember just following the official instructions.

If you would like to have the test re-run, you'll have to harass some real FB engineers, since the test was performed on a devbox that I don't have access too anymore. You're also more then welcome to try it yourself and post some alternate benchmarks.

I think I can promise to link to your results from the blog post.

FasterCGI with HHVM 13 years ago

Hi, my name is Julius and I performed the said benchmark while being an intern at FB.

Yes, we used opcode cache in PHP. I definitely don't consider myself to be an expert on PHP configuration. I used the default settings. I was obviously also very suspicious of the results that we got. To the extent, that I consulted a few people about what could be improved about the PHP setup. I remember opcode cache was the first thing I checked, since it's something everyone knows and talks about. It was turned on.

I will update the blog post first thing tomorrow (sorry guys, it's the middle of a night here in Poland, so don't feel like doing it right now).

Cheers.