40 comments

[ 2.6 ms ] story [ 106 ms ] thread
They have their work cut out for them if they want to support PHP 8 on ARM since that version will come with a JIT.
The article includes benchmarks of PHP8 beta on AArch64.

Quoting: "PHP-8 plans to feature a new JIT compiler that optimizes the PHP byte-code in the Opcache. The JIT is currently developed on x86 and is based on Lua’s JIT. As Lua’s JIT supports ARM64, we work with PHP developers to enable and to tune the Opcache JIT in PHP-8 to get the best performance on AWS Graviton processors."

That’s awesome. I haven’t kept up... last I saw they were rolling their own. LuaJIT is great.
(comment deleted)
They absolutely are rolling their own JIT (doing otherwise would reduce its value substantially or simply be infeasible.) The sentence above is just badly written in the original article. The PHP 8 JIT uses the "DynASM" library to help generate code in memory — which was originally developed for use in LuaJIT 1. (LuaJIT 2 does not use DynASM for its own runtime code generation, but it does use DynASM instead as a sort of "super" macro assembler when you compile it, making it easier to write its optimized, per-architecture interpreter.)

But "just" putting encoded instructions in a memory buffer is the easy part of it all, and that's all DynASM does. You still need thousands of lines of code backing it up to actually generate the right instructions, and implement appropriate optimizations.

Now we have following companies agressively pushing ARM64 optimization.

1. Amazon

2. Apple

3. ?? Add your here. :)

> pushing ARM64 optimization

Amazon is pushing ARM64 optimization because they make their own chips, and squeezing more juice from them is a way to extract more revenue from their initial investment.

doesn't that describe everyone?
Google, since they ship a web browser for a billion Android devices? Mozilla, since they do the same?
In the next 15 years, we'll say the same thing with RISC-V.
I hope so. I also hope someone will reinvent mass-market for Power/PowerPC architecture.

It's good to have a choice

Has there been much traction in building RISC-V application processors? Something like a RISC-V Raspberry Pi style SBC would be interesting to see, but the only thing like that I am aware of was enormously expensive (the HiFive Unleashed @ $999). I think the semi-open, high-volume, competitive ARM SoC market is going to make it very hard for RISC-V to find a niche in higher performing devices.
how about https://www.seeedstudio.com/Sipeed-Maix-Cube-p-4553.html ?

RISC-V Dual-Core 64-bit, with FPU and some 'machine learning' accelerator

or cheaper https://www.seeedstudio.com/Sipeed-Longan-Nano-RISC-V-GD32VF...

Raspberry Pi Foundation
With Apple and Amazon pushing ARM this hard, we should see some amazing chips in the next 5-10 years.

I haven't been this exited about hardware in a long time. Maybe it's because of my Raspberry Pis, but I'm childishly giggly.

I'm also not sure why I'm excited about ARM64 hardware as well. At least it's partly because in the imbedded world ARM operating systems are prevalent.

Also, it's clear Intel rested on their laurels and resisted real innovation for a long time. Now with heavy hitters entering the field (Apple, Amazon, etc), hopefully we see some real innovation in this silicon space.

What I'd like to see is SoCs with accelerated AI chips, similar to what's in the recent iPhones. If that type of hardware becomes widely available on the macs we almost all of us in SV develop on, then the libraries will follow.

Almost all develop on? lol!
Some people live in bubbles within bubbles.

Fortunately, we have data to confirm our suspicions: https://insights.stackoverflow.com/survey/2020#technology-de...

    Windows   45.8%
    MacOS     27.5%
    Linux     26.6%
    BSD       0.1%
Huh, I didn't expect the split to that even. That's pretty gratifying, in my opinion. That's far, far closer to 33% per major platform than I thought possible. (all possible apologies to the BSD demons out there, we love y'all and I wish it were more like 25% per major platform, all 4 of them)
In the embedded wold you're usually looking at ARMv6-M or some other microcontroller version, and they're likely running some stripped-down minimal OS.
There’s lots of ARMv7-A/R and v8-A and similar CPUs of other architectures in the embedded world. There’s a lot more to embedded than Cortex-M style microcontrollers.
Do Google and Microsoft also have plans to pursue ARM?
Microsoft have tried to market ARM devices, like the Surface Pro X. The performance sucks though from what I've heard. It's about as expensive as the iPad Pro, but far slower. It only supports 32-bit x86 emulation, and IIRC Rosetta on Apples A12Z based DTK (which has the same SoC as the iPad Pro) beats MS's emulation and supports 64-bit x86 macOS apps.
Can you link some benchmarks where Rosetta 2 beats MS's emulation in 32 bit only benchmarks?
Are there similar articles out there for other languages like Python or Node?
Any benchmarks with x86 proc? Nice to see ARM being supported more and more but what are the performance vs Intel / AMD CPUs?
> With the software changes in PHP-7.4 and PHP-8, WordPress can serve up to 17% more pages per second on M6g.4xl vs. M5.4xl [M5.4xl is AWS's default x86 processor]. Combined with the 20% lower cost of M6g instances, running PHP-7.4 and WordPress provides up to 34% better price/performance on M6g instances vs. M5 instances.
There are lots of work happening on Ruby as well. Example [1]. It seems everyone is hiding their geeky excited inner child and having fun working on it.

I am starting to wonder if Apple timed this all along or did the two ARM announcement all within 6 months happens to be coincidence.

[1] https://bugs.ruby-lang.org/issues/17021

(In case this isn't changed to the official AWS blog link)

"There are two other patches that impact the performance of the WordPress-NGINX benchmark, and both have been applied to master and PHP-7.4 branch:"

A patch to disable the use of huge pages in memory allocator fixed a 10% performance regression: https://github.com/php/php-src/commit/928c42211f737640e4dc3c...

The patch to enable the Zend Optimizer on ARM64 accounts for about 5% of better performance on M6g instances https://github.com/php/php-src/commit/4d7df449d0ab389b01b45f...

Thanks to Amazon and Apple CPUs are Sexy again.