
Wikipedia on HHVM - jamesgpearce
http://hhvm.com/blog/7205/wikipedia-on-hhvm
======
TazeTSchnitzel
They note that 5.6 has some substantial performance improvements over 5.3. I'd
point out that PHP 7, coming out later this year, will be even faster (perhaps
as much as 2x 5.6), since some very smart people have done some big internal
refactoring in the Zend engine, largely to reduce allocations, pointer
indirection, and memory usage. These efforts combined have resulted in pretty
big performance gains, making PHP 7 more competitive with HHVM performance-
wise. In addition, writing PHP extensions is somewhat nicer now.

Zeev Suraski (one of the original two Zend Engine authors along with Andi
Gutmans, also co-founder of Zend, Inc.) did some benchmarks:

[http://zsuraski.blogspot.co.uk/2014/07/benchmarking-
phpng.ht...](http://zsuraski.blogspot.co.uk/2014/07/benchmarking-phpng.html)

[http://zsuraski.blogspot.co.uk/2014/07/benchmarking-phpng-
ma...](http://zsuraski.blogspot.co.uk/2014/07/benchmarking-phpng-magento.html)

However, bear in mind that those benchmarks were faked* by Zeev, a Zend Engine
proponent. Benchmarks faked* by HHVM engineers might show a larger gap. ;)

* I'm not using "faked" in its normal sense. They probably weren't fraudulent, but I am a believer that we should say "fake a benchmark" and not "make a benchmark" given that they can be so circumstantial and misleading: [http://blog.ajf.me/2014-10-23-on-benchmarks](http://blog.ajf.me/2014-10-23-on-benchmarks)

Disclaimer: I am, myself, biased towards the Zend Engine, I'm a php-src
committer.

~~~
scott_s
I make a point to say "synthetic benchmarks" for such circumstances. It
clearly conveys that the benchmark is contrived, likely to demonstrate a
particular point, but it avoids the negative connotations.

~~~
TazeTSchnitzel
Ah, that's a good term for it. I like "faked" because it has added humour
value (it's rather "ha ha only serious"). Without using a disclaimer around
it, though, someone will probably smack me.

~~~
eru
Use `fake' in speech, where you can convey more context, and `synthetic' in
writing?

~~~
TazeTSchnitzel
I'd say the other way around, honestly. In writing I can stick a * there so
it's obvious that there's more to it than it seems. In speech, unless it's
explained beforehand, it might not be a good idea.

~~~
EGreg
I really thought that when you wrote "faked" that reflected on Zeev's
character. That he was trying to pull a fast one. Only after encountering the
disclaimer did I realize what you meant. Many people won't read the
disclaimer, and therefore when dealing with someone's reputation you should
pick a word which might avoid misunderstanding.

~~~
TazeTSchnitzel
Fair point.

I might say some things about Zeev, but I certainly wouldn't say he's a liar.
He's a talented developer.

~~~
chrisseaton
Saying someone's faked a benchmark is an extraordinarily serious accusation of
professional malpractice. I think your little joke is a very misguided.

~~~
mentat
Having seen how the sausage is made at many performance oriented companies
this seems to be a bit of an overstatement.

------
girvo
Hooray! I'm a massive fan of HHVM, though not just because it's so fast: Hack
is something I'm really interested in. The collections libraries in the stdlib
are brilliant to use, and the static typing makes writing some types of code
easier and keeps some bugs out of my codebase. The only thing I wish to see is
more editor/IDE support for it, so I helped contribute to hack-sublime and
have been writing my own plugin for Komodo Edit/IDE.

HHVM and Hack were the impetus for me to learn OCaml, which is a lovely
language. It's good to see more and more places picking up HHVM, and it's also
great to see PHP5.6 and 7 increasing performance drastically, too!

------
azinman2
Congrats to FB for donating their engineering resources to helping Wikipedia.
How do we make this more the norm for large corporations with talent?
Something akin to Google's 10% time but with a social-good focus? It might
help silicon valley's reputation in a larger sense.

~~~
TazeTSchnitzel
Bear in mind that Facebook has a vested interest in getting other large sites
to use HHVM, so that they're not the only ones who want to maintain it.
They're not doing this _purely_ for the greater good.

That said, I agree, Facebook is doing awesome stuff here.

~~~
ics
> so they're not the only ones who want to maintain it

Being completely unaffiliated with Facebook, I think this still counts as
'greater good' for many.

~~~
TazeTSchnitzel
Sure. I'm just saying that they have business motives to do so, it is not
merely out of the kindness of their hearts. Though I am sure it is also partly
the latter, they have some wonderful engineers. :)

~~~
azinman2
As far as I'm aware, HHVM isn't something that FB is charging for. If that's
true, what's the business interest?

~~~
TazeTSchnitzel
The same one I mentioned before: getting other people to use it benefits them,
as other people will help maintain it because they also have a stakehold in
its success. It's a huge project to maintain.

~~~
FooBarWidget
If you define it that way then there's almost nothing in the world that would
categorize as altruism. Helping kids in Africa? It's only to make yourself
feel good. Helping that fallen granny get up? It's to make yourself look good
in front of others. Etc. If you go that far, both egoism and altruism will
have completely lost their meanings.

~~~
estefan
>Helping kids in Africa? It's only to make yourself feel good. Helping that
fallen granny get up? It's to make yourself look good in front of others.

Exactly! Of course we do things to make ourselves feel good. And since helping
other people makes us feel good, why shouldn't we be honest about our motives?
It's win-win.

------
thehal84
This is great news to see. I have tested HHVM with our particular application
load and I found it to be a bit tricky to tune just right. However PHP 5.6 has
been solid in production for us handling 5 billion requests daily.

~~~
azinman2
Wow. What are you running that's getting 5 billion requests daily?

~~~
thehal84
Mobile Ads and Mobile Analytics for about 500 million devices world wide.

------
ahoge
The y-axis of the first graph should start at 0. Being more than twice as fast
is quite a lot. There is no need for cheap tricks.

If you aren't visualizing tiny deltas, don't truncate the y-axis. It's
misleading.

~~~
swtaarrs
That was just the default presentation mode of the tool I got the graph from.
It's been updated.

~~~
ahoge
Thanks. Graphs are so much better without "fine print".

------
riquito
The results would have been very interesting if they switched from PHP 5.6,
but switching from 5.3 to HHVM is impossible to know how much of the
improvements are due to the newer PHP and how much to HHVM. Nevertheless,
Wikimedia must be really satisfied.

------
killertypo
how does HHVM compare to PHP 7 in terms of speed savings? PHP 7 is supposed to
be pretty damn fast from what I have seen. I guess benchmarks are hard to read
because they're dependent upon a lot of factors. It would be interesting to
see two sites at similar scales running competing engines for PHP (hhvm vs.
PHP 7).

~~~
TazeTSchnitzel
Minor point of style: We tend to refer to phpng in lowercase, because that's
the branch name. Although at this point, since it no longer exists as a branch
(it's long since been merged into trunk) and there have been subsequent
performance optimisations, the names "PHP 7" or "Zend Engine III" are possibly
better.

Also, I partly responded to this above:
[https://news.ycombinator.com/item?id=8848129](https://news.ycombinator.com/item?id=8848129)

~~~
killertypo
TIL, thank you for that.

------
cdnsteve
Thank you to both Wikipedia and Facebook for being transparent and sharing
this back to the open source community. It's these type of joint efforts that
really move the web forward. Hats off.

------
chubot
Intersting, I didn't realize PCRE now has JIT support.
[http://sljit.sourceforge.net/pcre.html](http://sljit.sourceforge.net/pcre.html)

Also, that page points to Apple's YARR, which I didn't know about either (and
Chrome's irregexp, which I did).

------
ahp
Might somebody be willing to explain the difference between the two versions?

> using HHVM from GitHub rather than our internal repository.

~~~
swtaarrs
The only differences are some Facebook-only extensions we use to interface
with internal services, and a different build system. The code is exactly the
same otherwise.

------
yc1010
I would love to use hhvm, unfortunately my IDE of choice PHPStorm doesn't
support it yet :( despite a big long list of customers requesting it.
[https://youtrack.jetbrains.com/issue/WI-21737](https://youtrack.jetbrains.com/issue/WI-21737)

What editor do Facebook and Wikipedia use for their HHVM/PHP development out
of interest?

edit: downvoted? really? for what?

~~~
bd808
I use vim. Other MediaWiki developers use emacs, PHPStorm, TextMate, Notepad++
or whatever editor or IDE the individual developer is most comfortable with.

------
nodesocket
"Peak CPU utilization dropped from about 70% to 12%, almost a 6x improvement."

That is substantial, and HHVM should bear to rest some of the claims (trolls)
that PHP is not performant.

~~~
reitzensteinm
That you can claw back some performance by using a partially conforming
alternate language implementation does not prove the "trolls" wrong.

Yes, with enough engineering effort you can move mountains, but if performance
is critical and you don't have a legacy code base like Facebook does, reaching
for the php hammer is insanity.

The real reason why performance isn't a big downside with php is that it
usually just doesn't matter.

If a php implementation can service 100 req/s, and a Java implementation (an
ad absurdum) 100,000 req/s, and your site peaks at 5 req/s, either is just
fine.

In other words, "You're probably not Pintrest".

~~~
TazeTSchnitzel
> That you can claw back some performance by using a partially conforming
> alternate language implementation does not prove the "trolls" wrong.

You're talking as if PHP is slow. It isn't, it's very fast, speed is actually
one of its advantages (or was historically, anyway). Its alternatives (Python,
Ruby) are sometimes marginally slower. With its next release, it will receive
a significant performance boost, and minor versions usually include small but
significant performance gains.

Yes, it's not as fast as say, C, C++, Java, C#. It doesn't need to be, nor
does anyone expect it to be: it's a dynamic language that allows for rapid
development. But to talk about it like it's something horribly slow that you'd
never use in 2015 is simply wrong. It is competitive.

