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

  • uid313
    replied
    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.

    Leave a comment:


  • GreenReaper
    replied
    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.)

    Leave a comment:


  • uid313
    replied
    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.

    Leave a comment:


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

    Leave a comment:


  • Vistaus
    replied
    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

    Leave a comment:


  • TheOne
    replied
    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

    Leave a comment:


  • benjiro
    replied
    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.

    Leave a comment:


  • uid313
    replied
    Originally posted by MrEcho View Post

    There is PHP-FPM now, and PHP it self can self host, to a limited degree. The thing is which PHP, its not a persistent application, so doing a async/await isnt really needed. And with no real threading model, it would be pretty hard to implement. And there are extensions that can kind of do that.
    As for data types, the types system is getting pretty advanced, https://wiki.php.net/rfc
    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.

    Leave a comment:


  • MrEcho
    replied
    Originally posted by uid313 View Post

    If there is anything bad to say about PHP it is:
    • For historical reasons the global namespace is polluted with too many functions.
    • For historical reasons many functions are inconsistently named (some with underscore, some without).
    • For historical reasons there are functions return weird error codes such as -1 instead of throwing exceptions.
    • There are no async/await keywords, neither are there any support for promises.
    • There is no application server.
    • The object orientation is limited, and does not include data types (strings, integers, etc).
    There is PHP-FPM now, and PHP it self can self host, to a limited degree. The thing is which PHP, its not a persistent application, so doing a async/await isnt really needed. And with no real threading model, it would be pretty hard to implement. And there are extensions that can kind of do that.
    As for data types, the types system is getting pretty advanced, https://wiki.php.net/rfc

    Leave a comment:


  • uid313
    replied
    I haven't coded in PHP for years. I used to like coding in PHP, but then moved on to C# on ASP.NET. After that I used to thing PHP a poor, inconsistent, terrible hacked-together language only relevant by the insane popularity of WordPress.
    There might have been some truth in that, but since then, PHP has seen huge improvements and advancements, and I think it deserves to be reevaluated.

    Huge performance improvements, the Composer package manager, the PHP-FIG with the PSR standards, the optional typing, traits, etc. It's all very nice things that makes PHP much more attractive than it was.

    If there is anything bad to say about PHP it is:
    • For historical reasons the global namespace is polluted with too many functions.
    • For historical reasons many functions are inconsistently named (some with underscore, some without).
    • For historical reasons there are functions return weird error codes such as -1 instead of throwing exceptions.
    • There are no async/await keywords, neither are there any support for promises.
    • There is no application server.
    • The object orientation is limited, and does not include data types (strings, integers, etc).


    Originally posted by bash2bash View Post
    These days, I like python as well, I use it for various GTK+3 projects as a GUI language.
    I also use Python for GTK 3 projects. It is rather nice because Python is much more easier to use than C, and it just works out-of-the-box on Ubuntu without fetching any development environment, tooling or development libraries.
    Now you write GTK applications in JavaScript too, but I haven't tried that. The GNOME Maps application is written in JavaScript. So then you could use TypeScript too and transcompile that into JavaScript, maybe that would be nice.

    Leave a comment:

Working...
X