zmxz
Joined 4 years ago
Joined 4 years ago
Creating a few thousand "new object" takes less than 5 msec. Test it. I have.
FrankenPHP uses a Go-based balancer that distributes requests to array of pre-started workers. Just like PHP-FPM does.
If you already used PHP's parallel extension, then you should at least know the difference between thread and process instead of typing buzzwords, thinking it makes you look cool if you use them :)
I, for one, would love to be wrong about this and that FrankenPHP with all the other alternative runtimes actually brought benefits.
The apparent speedup comes from the fact it's not shared-nothing, meaning that objects from previous requests (and variables) are persisted and present in subsequent requests. This makes it work exactly like Node.js, removing the wonderful part of PHP which is that it automatically cleans up all the crap devs created and creates clean slate when next request is to be executed.
All of these "alternative" runtimes are false positives, because they're quick for first few requests but get slower and slower for the subsequent ones. Then, the workers are killed and restarted (precisely what PHP-FPM does too).
Since there's no new engine behind executing PHP, the only way FrankenPHP (and others) can yield any performance is when they're benchmarked against misconfigured PHP-FPM (opcache off, JIT off, persistent connections off).
It's not my cup of tea. I like that there are attempts at doing <something> but turning PHP execution model into Node.js execution model isn't the way to go.
I find it cheaper to throw a few bucks at stronger hardware compared to risking accurate execution to become flaky because shared-nothing is now unavailable.
This really isn't that hard, we're not trying to travel to Mars.
Anyone who is not capable of taking care of what you called footgun in a way where they automate - that person is not serious.
If there's a pretty huge problem - manage it. That's your job as programmer. If you're lazy, sloppy and prefer whining online over being proud of your work - there's no programming language that will take care of that for you.
What kind of logic is this, to blame the tool because you have no clue how to use it?
If I have to deal with files, I'll create a class and I'll combine functions file_exists, is_file, is_writable, file_get_contents, file_put_contents (and new fsync) in conjunction with stream_context_create. I can even get the errors that OS spits out and test for what exactly went wrong, but you obviously ignored that and gave up. I can tell you used the language sporadically, not professionally.
You're taking a small, localized issue that arose, while your job as programmer is to get around idiosyncrasies in programming languages with the focus on achieving the end goal.
I've a list of terrible things that PHP does but I have one for JS/TypeScript/Go/Rust/<you name it>.
My job is to know these and achieve goals, not to criticize languages because file handling in it is not the same as in C++ and language didn't fire up 50 AWS instances to spam X.com with messages in hopes that I somehow notice them.
Was that everything? You basically state there's a problem because you didn't use the function correctly and language didn't fall head over heels to stop you from doing silly things due to slopiness?
P.I.C.N.I.C.
You can, it's via `error_get_last()`. We've had that for 17 years..
It's hard to trust a stranger from internet claiming something, but we are in IT so it should be relatively trivial to prove your claims, right?
USA embraced capitalism and is geared towards proving concepts FAST and enabling networking. I love that about USA and I miss that in Europe, when it comes to IT/Tech sector in particular.
I'm not aware if Europe produced anything of significance in the past 30 years, we're lagging heavily behind USA/China and that's a fact. One could argue that Linus Torvalds is European hence Linux === European but I won't resort to such petty claims.
We produced very little value. We're having issues due to language discrepancy. Even though a lot of people speak English, it's often the case that we Europeans aren't able to communicate as well using English as we can in our native tongue. The lack of unified language is visible. The diversity in culture drives people to favor their own, we're bad at teamplay (this is from my personal experience and I am guilty of this).
There's many valuable lessons we could have learned from USA but we failed to apply them. We have various freely available systems that are great at, say, education - but education means nothing when it's difficult to apply it once people are done with it.
I worked with plenty of people from USA and I had huge prejudices towards them, in terms of "they talk a lot" or "they are not as competent, they are really slow when it comes to pumping out code" but I learned I was wrong to the point it's not funny. If anything, USA is really good at starting and pushing projects out that actually work.
Ultimately, do we even have a microchip factory (we might, but I'm unaware of it)?
Sorry for the wall of text, I just wanted to explain my POV and agree with you.
Personally, I'd love to see movement in EU's tech sector. We're 30 years behind USA in tech. I won't touch upon quality of life or similar topics because I'm interested in exploring technology.