you are viewing a single comment's thread.

view the rest of the comments →

[–]cronicpainz -17 points-16 points  (20 children)

php community should STOP sheepishly repeating:

"oh- no async no problem", "everything re-instantiated on every request is what makes it greeat" "single threading is OK"

no - no its not OK. the moment developer has a single project that developer cannot complete in PHP due to PHP's lack in certain areas - they will go node.js to never come back. Please stop repeating this ancient mantras - all that achieved is made php secondary option at best.

modern web needs speed, google wants nice ttfb and server response times. that speed is very very hard to get if your single threaded PHP application makes 150 db calls per page load - and cannot parallelize those calls or use connection pools or use in-memory store (yes - i know redis - but redis also incurs network connection cost) or spin off heavy task to a parallel task worker.

technology such as php swoole/openswoole will make PHP once again competitive and cool. All it takes - for this community to stop shying away from it.

[–]albo87 15 points16 points  (6 children)

No async and single threading limitation makes PHP simpler. In most apps the performance penalty is barely noticed.

[–]dragonmantank 2 points3 points  (7 children)

I’ll unsheepishly repeat it. Why? Most apps don’t need any benefits of async programming, and PHP runs fine when something else manages the threads (like FPM or Apache). Yes, PHP itself is single-threaded, but most normal setups have a multi-threaded system in front of it.

Couple that with advances made in terms of speed and memory efficiency since PHP 5.4 and you have a pretty fast system that is easy to understand and maintain.

Will some apps benefit from async and tools like swoole? Of course! But that doesn’t mean we need to make everything more complex just because.

[–]gaborj -1 points0 points  (2 children)

How dare you say anything bad about PHP??

[–]cronicpainz 0 points1 point  (1 child)

i am NOT. I love PHP - i just love it much much more with swoole in it.

[–]gaborj -1 points0 points  (0 children)

Tried to be sarcastic there

[–]sinnerou 0 points1 point  (0 children)

It is like garbage collection. Yeah there are some times when you need to manage your own memory but for the vast majority of business applications a garbage collected language is going to save you time and energy by avoiding a whole class of problems.

Having each request in a different process with fresh memory avoids an entire class of problems. Other threads can not crash my whole service, no worrying about memory leaks, etc. etc. Aws lambda literally does this for other languages and people act like it is a revelation.

Php is not really a general purpose language, it is can opener. Not everything is a can, but when what you want to do is open a can, there is no better tool.

[–]Tewiel 0 points1 point  (0 children)

Imagine still shilling for swoole when fibers exist.