18 comments

[ 2.8 ms ] story [ 43.3 ms ] thread
Personally, I've found the biggest performance improvement comes with instantiating classes. I don't understand the internals well enough to explain, but in profiling, I've always seen significant improvements.
Spaceship operator is mentioned, but nothing about the much improvemed type declarations?
<<Need a consultation of PHP developmer? CONTACT GURU OF PHP!>>
He can also write your web services in runtime interpreted C++!
> You may already know that PHP, C++, Swift, and any other modern programming language is not communicating directly to the hardware. The programming language is just an easier way to talk to the machine. The machine native language is still binary code.

> One way or another, each programming language is translated to the binary code by using the compiler. PHP is no different. But what makes it unique is a Just in Time engine, that allows compilation of the code during the execution of the program. This principle is also known as dynamic translation.

I mean, I guess this weird explanation is fine for a php consultant, but honestly I wouldn't trust any results presented next a description this wrong.

(comment deleted)
The first part is kind of baffling. I'm not even sure what is trying to be said there. English as a second language?

The second one if actually wrong unless something changed very recently, PHP is not JIT compiled (at least not to machine code). It is a bytecode VM. I remember the discussion came up and optimizing the byte code was actually improved performance more than proof of concept JIT did for common PHP use cases.

PHP 8 is supposed to have a JIT I believe.

Not to be overly dismissive, but this article is just... weird?

The arguments for why switch are pointless, no mention of the actual benefits. Statements like "Hopefully, JIT was integrated into PHP 7", and a very special explanation of compilation and jit. It makes me not trust anything written here.

The person writing this has no idea about what he's talking about, so you're not the only one finding it untrustworthy.

Seriously, how can a person call himself a "PHP guru" and at the same time tell people that it's faster as a result of JIT compilation when PHP doesn't use JIT compilation? Amazing.

The article's website does not load for me with CloudFlare DNS (1.1.1.1)
"JIT was integrated into PHP 7, which is why it has almost the same results as HHVM."

"PHP guru"

PHP doesn't use JIT compilation...

HHVM does have JIT, but you're right that PHP 7 does not. Maybe they were thinking about the AST. Anyway, it looks like they've corrected the article.
This article is non-sense from a technical point of view: there are so few details on what is tested, on which conditions, ...

There for example is no mention of the php7 version tested: 7.0? 7.1? 7.2? No version of hhvm either. No clear details on what the tested code does: what kind of setup/options is used, which Wordpress page(s) is actually called. How much memory the machine has, how php is configured regarding the opcache, ...

Also, why posting this to HN now? Php 7 has been released more than 2 years ago, those improvements have been discussed a long time ago.