Php performance

dose anyone know about the future changes in php? dose php support JIT compiler in next version to improve performance? (cause node js has very good performance compare to php) and php has problem supporting real-time web applications
another question i have:
will php support asynchronous request in php core? (async/await like hack languge which support by facebook) cause using third party code like react php make problem in projects.

PHP will support JIT compiler in next version (probably PHP 8)
Source

1 Like

If you’re talking about web applications the main bottleneck will still be the fact that PHP runs on a remote machine and we do not have a hyperspace transport yet.

2 Likes

I wonder what are some real-life comparison benchmarks?

From my experience, the biggest overhead in php comes from huge frameworks and CMS systems that are used more and more often. Systems like Wordpress can be an order of magnitude slower than a slim custom made web site. People also use more and more components and libraries (thanks to Composer) and so the demands on php are getting higher.

Maybe he meant that php cannot push requests to clients via websockets and also lacks event mechanisms for that? I would certainly be glad to see this in php.

1 Like

Although I would question whether you should still use PHP then, as currently the tool of choice for that is Node.js. It seems to me that PHP is steering more and more towards JS (anonymous functions, spread operator, …)

1 Like

Certainly, but if PHP supported push requests then it could also be the tool of choice :slight_smile:

1 Like

php has really good frameworks and cms but has some distance from other languages like go lang which for example support concurrent requests, if php add some of these thing it could be really good.:slight_smile:

php 7 add more tools to be like JS, but i think php classes is really better than JS in structure.

Well, JS doesn’t have classes to begin with (ES6’s classes are only syntactical sugar that doesn’t have the least to do with real classes), so the comparison is invalid.

thanks to this project and framework which add some functionality to php (“github.com/kraken-php/framework”). but i can not believe the results of comparisons

This looks interesting - does this mean we can use websockets with kraken-php? There is also ReactPHP. Does this mean we can use websockets in PHP just with these frameworks? Last year I made a chat application and it uses the traditional interval polling - it would be sweet to be able to change it to real-time messaging without having to use node.js.

this framework has a chat demo application and make working with websockets easily they inspired by socket.io, you can test, and has good features that developing real time web application like games and chat apps easily. they added a new library for asyncrounous php
github.com/dazzle-php/dazzle/blob/master/README.md

Did you use it?

I’m trying to wrap my head around how these frameworks actually work if they themselves use plain PHP and don’t seem to require any special installations on the server apart from the framework code (pthreads extension is optional). This would indicate PHP can do it on its own but maybe not in a convenient manner.

A normal PHP script has a certain allowed timeout - if my server allows maximum 30 seconds for a PHP script then a framework like this would need to spawn a new PHP script at most every 30 seconds - a sort of daemon - and run those event loops all the time.

i test a demo chat application and has a good performance but in installing a framework sketlon i have problem i dont know why i got error.
but it was really strange for me without any c extension like phalcon extension, they got this performance with plain php

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.