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."
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.
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.
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.
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.
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.
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.
> 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.
40 comments
[ 2.6 ms ] story [ 106 ms ] threadQuoting: "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."
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.
1. Amazon
2. Apple
3. ?? Add your here. :)
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.
It's good to have a choice
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...
You still can get linux on the K210 https://www.cnx-software.com/2020/02/17/how-to-build-run-lin...
and it seems it's mainlined now: https://www.phoronix.com/scan.php?page=news_item&px=RISC-V-C...
I'm confused when they say it's based on LuaJIT? Do they mean PHP is being transcoded to Lua and run by LuaJIT.
Or do they mean that PHP-JIT is based on "DynASM" - which is a subproject of LuaJIT?
http://luajit.org/dynasm.html
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.
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.
Fortunately, we have data to confirm our suspicions: https://insights.stackoverflow.com/survey/2020#technology-de...
But PyPy has an arm64 JIT since last year: https://morepypy.blogspot.com/2019/07/pypy-jit-for-aarch64.h...
There is some information about Python optimization, especially for data science type applications, in our getting started guide: https://github.com/aws/aws-graviton-gettting-started/blob/ma...
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
"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...