Announcement

Collapse
No announcement yet.

PHP 7.4 Performance Benchmarks Show A Nice Improvement - But PHP 8.0-dev Is Running Even Faster

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

  • #11
    Originally posted by uid313 View Post
    But I might want to do things like; accept a request, send a mail, post a webhook, and notify a service bus, and return a response, but I wouldn't want the client have to wait for things like sending mail, webhook or notifying a service before before it can receive a response.
    Or I might want WebSockets.
    There are solutions for that. The issue with the order is, what if a mail fails to transmit, so you service bus / webhook response are already a issue.

    When you do not care about the response, then you simply have a 3th party process / server handle the mail sending, while you process the webhook / service bus. If you get a invalid responds from the 3th party process or a failure ( use a cron or whatever to check every X times ), you roll back the webhook / service bus ( checking is something you need to do with a async process anyway in case of a failure ). I see little reason to let PHP handle large mails ( i assume that is your issue ) sending anyway.

    Anything that is not 10MB mails will be so fast to handle anyway, that even in synchronous mode ( mail, wait responds, hook / bus ) it does not affect the clients. If your handling 1000]s of mails, that exceed your Ethernet connection, async is not going to help your anyway.

    People simply make things out to be more difficult, then what they are. For most people 95% of the code that your write is synchronous anyway and async code complicates things.

    If you really want to push async, then use Swoole or any of the dozen PHP based solutions that introduce async responds handling for PHP.

    Comment


    • #12
      Originally posted by uid313 View Post

      But I might want to do things like; accept a request, send a mail, post a webhook, and notify a service bus, and return a response, but I wouldn't want the client have to wait for things like sending mail, webhook or notifying a service before before it can receive a response.
      Or I might want WebSockets.
      All that is provided on a single extension named swoole https://github.com/swoole/swoole-src

      Comment


      • #13
        Originally posted by AsuMagic View Post
        lol


        lol


        No wonder over 95% of users run on Windows!


        What?


        Indeed.


        ... How is wasm related to node?


        ok

        Comment


        • #14
          Originally posted by bash2bash View Post
          too many lol's make you a lol guy
          I'd rather have that than to blatantly lie...

          Comment


          • #15
            Originally posted by benjiro View Post

            There are solutions for that. The issue with the order is, what if a mail fails to transmit, so you service bus / webhook response are already a issue.

            When you do not care about the response, then you simply have a 3th party process / server handle the mail sending, while you process the webhook / service bus. If you get a invalid responds from the 3th party process or a failure ( use a cron or whatever to check every X times ), you roll back the webhook / service bus ( checking is something you need to do with a async process anyway in case of a failure ). I see little reason to let PHP handle large mails ( i assume that is your issue ) sending anyway.

            Anything that is not 10MB mails will be so fast to handle anyway, that even in synchronous mode ( mail, wait responds, hook / bus ) it does not affect the clients. If your handling 1000]s of mails, that exceed your Ethernet connection, async is not going to help your anyway.

            People simply make things out to be more difficult, then what they are. For most people 95% of the code that your write is synchronous anyway and async code complicates things.

            If you really want to push async, then use Swoole or any of the dozen PHP based solutions that introduce async responds handling for PHP.
            Hmm, yeah you might be right. But I code in JavaScript, Python and C# so there I have async/await, so I thought it was maybe a bit bad that PHP didn't have that.

            Comment


            • #16
              Originally posted by uid313 View Post
              • The object orientation is limited, and does not include data types (strings, integers, etc).
              At least now they are letting developers tighten up on which data types you're talking about. The first thing in PHP 7.4 new features is that class properties can have type definitions. This might have positive performance implications, but the most important one is improvement correctness.

              PHP still has a lot of legacy support. This is an important feature; we do not have time to rewrite every piece of our legacy codebases - there are already way too many people stuck on PHP 5.6 for one reason or another. But it's come a long way, the performance is much better now, and - like JavaScript - it's much easier to write maintainable new code. (It also shouldn't be that hard to polish up the old code when you have the time.)

              Comment


              • #17
                Originally posted by GreenReaper View Post

                At least now they are letting developers tighten up on which data types you're talking about. The first thing in PHP 7.4 new features is that class properties can have type definitions. This might have positive performance implications, but the most important one is improvement correctness.

                PHP still has a lot of legacy support. This is an important feature; we do not have time to rewrite every piece of our legacy codebases - there are already way too many people stuck on PHP 5.6 for one reason or another. But it's come a long way, the performance is much better now, and - like JavaScript - it's much easier to write maintainable new code. (It also shouldn't be that hard to polish up the old code when you have the time.)
                Yeah, this new optional typing for class properties in PHP 7.4 is amazing, and I really like this feature!

                Still, it would be nice if strings were objects, so you could do things like "hello".reverse() as you can do in other object-oriented languages such as Java, JavaScript, Python, C#, etc.

                Comment

                Working...
                X