Announcement

Collapse
No announcement yet.

PHP 8.1 Performance Is Continuing To Improve With Early Benchmarks

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP 8.1 Performance Is Continuing To Improve With Early Benchmarks

    Phoronix: PHP 8.1 Performance Is Continuing To Improve With Early Benchmarks

    Each PHP release continues to improve in the department of performance. Even after the sizable performance improvements made with PHP 7, PHP 8 is continuing to further optimize the performance regardless of using its new JIT. While there still are several months to go until the official PHP 8.1 release, here are a few early benchmarks looking at the PHP CLI performance of PHP 8.1 and prior PHP releases...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    I would like to see comparison with other web programming languages.

    Comment


    • #3
      Great to see, especially if this translates to RISC architectures.

      Comment


      • #4
        Originally posted by lamka02sk View Post
        I would like to see comparison with other web programming languages.
        It's not really doable. It may be better at number crunching than say JS, but in real world performance it's a lot slower.

        Primarily because JS bakes in concurrency and doesn't create a new instance every time a page is loaded.

        Comment


        • #5
          Originally posted by Turbine View Post

          It's not really doable. It may be better at number crunching than say JS, but in real world performance it's a lot slower.

          Primarily because JS bakes in concurrency and doesn't create a new instance every time a page is loaded.
          From what I know, JS can't do concurrency, only async. Anyway, PHP startup is pretty efficient nowadays and if you combine it with PHP-FPM, I wouldn't really worry about performance much since the processes are idling and waiting for incoming requests.

          Comment


          • #6
            Originally posted by lamka02sk View Post
            From what I know, JS can't do concurrency, only async.
            For web use there's probably little need for actual concurrency. It's possible to use a process manager similar to PHP-FPM with Node.js for booting multiple server app instances to make use of more CPU cores. Of course additional libraries support use of threading etc. but that is up to the programmer to manage then.

            Originally posted by lamka02sk View Post
            Anyway, PHP startup is pretty efficient nowadays and if you combine it with PHP-FPM, I wouldn't really worry about performance much since the processes are idling and waiting for incoming requests.
            Don't conflate the PHP interpreter process with the actual PHP application such as WordPress or Symfony-based apps. The PHP application itself, e.g. WordPress, will still be booted and shutdown for every single HTTP request! That's insane waste of resource even if much of the raw initialization phase can be skipped via memory and file caches.
            Last edited by curfew; 16 July 2021, 09:22 PM.

            Comment


            • #7
              Originally posted by Turbine View Post
              It's not really doable. It may be better at number crunching than say JS, but in real world performance it's a lot slower.
              Primarily because JS bakes in concurrency and doesn't create a new instance every time a page is loaded.
              Originally posted by lamka02sk View Post
              PHP startup is pretty efficient nowadays and if you combine it with PHP-FPM, I wouldn't really worry about performance much since the processes are idling and waiting for incoming requests.
              PHP-FPM only keeps a new PHP instance ready to load your app when a new request is initiated, but you still have to start your whole application with every request, which may take a non negligible amount of time. Preloading helps a bit (it means you don't have to load every single class from disk each time), but you still have to execute the code which is not the case in a typical Django or NodeJS app.

              The equivalent to these frameworks in PHP would be ReactPHP, Swoole or Roadrunner (or Laravel Octane which relies on them) which will allow you to start your whole app and then wait for incoming requests. It can make thing a whole lot faster in some instances, but the drawback is that then you need to worry about memory leaks, which is usually not a big deal in a traditional PHP setup.


              Comment

              Working...
              X