6 ms·
Improving Performance of PHP for Arm64 and Impact on Amazon EC2 M6g Instances
- hanikesn 6y agoThe correct url is: https://aws.amazon.com/blogs/compute/improving-performance-of-php-for-arm64-and-impact-on-amazon-ec2-m6g-instances/ https://aws.amazon.com/blogs/compute/improving-performance-o...
- sroussey 6y agoThey have their work cut out for them if they want to support PHP 8 on ARM since that version will come with a JIT.
- timthorn 6y agoThe 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."
- sroussey 6y agoThat’s awesome. I haven’t kept up... last I saw they were rolling their own. LuaJIT is great.
- deleted 6y ago[deleted]
- aseipp 6y agoThey 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.
- ramshanker 6y agoNow we have following companies agressively pushing ARM64 optimization. 1. Amazon 2. Apple 3. ?? Add your here. :)
- rumanator 6y ago> 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.
- _alex_ 6y agodoesn't that describe everyone?
- saagarjha 6y agoGoogle, since they ship a web browser for a billion Android devices? Mozilla, since they do the same?
- rvz 6y agoIn the next 15 years, we'll say the same thing with RISC-V.
- indeyets 6y agoI hope so. I also hope someone will reinvent mass-market for Power/PowerPC architecture. It's good to have a choice
- ac29 6y agoHas 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.
- tiffanyh 6y ago> "The JIT is currently developed on x86 and is based on Lua’s JIT. As Lua’s JIT supports ARM64, ..." 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 http://luajit.org/dynasm.html
- tyingq 6y agoYes, they are using DynASM. https://github.com/php/php-src/blob/master/ext/opcache/jit/README.md https://github.com/php/php-src/blob/master/ext/opcache/jit/R...
- tambourine_man 6y agoWith 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.
- ed25519FUUU 6y agoI'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.
- UhDev 6y agoAlmost all develop on? lol!
- hu3 6y agoSome people live in bubbles within bubbles. Fortunately, we have data to confirm our suspicions: https://insights.stackoverflow.com/survey/2020#technology-developers-primary-operating-systems https://insights.stackoverflow.com/survey/2020#technology-de...
- bloopernova 6y agoWindows 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)
- 6y ago
- bluedino 6y agoAre there similar articles out there for other languages like Python or Node?
- ma2rten 6y agoI'm assuming node already is fast on ARM since it uses the same javascript engine as a major mobile web browser.
- floatboth 6y agoAnd CPython is already slow on everything. :D But PyPy has an arm64 JIT since last year: https://morepypy.blogspot.com/2019/07/pypy-jit-for-aarch64.html https://morepypy.blogspot.com/2019/07/pypy-jit-for-aarch64.h...
- _msw_ 6y agoDisclosure: I work at AWS on building cloud infrastructure 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/master/python.md https://github.com/aws/aws-graviton-gettting-started/blob/ma...
- Thaxll 6y agoAny benchmarks with x86 proc? Nice to see ARM being supported more and more but what are the performance vs Intel / AMD CPUs?
- why_only_15 6y ago> 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.
- ksec 6y agoThere 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 https://bugs.ruby-lang.org/issues/17021
- rob-olmos 6y ago(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/928c42211f737640e4dc3c9702ba833c3059bddf 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/4d7df449d0ab389b01b45fa1bb9bf2b4a8755545 https://github.com/php/php-src/commit/4d7df449d0ab389b01b45f...
- rafaelturk 6y agoThanks to Amazon and Apple CPUs are Sexy again.