News for hackers. Stuff that matters.
Re:PHP in 2019 by return1 on Wednesday May 15, 2019 @07:38AM (#19918383)
> Is performance that much of a big deal for most people?

For most people outside VC-funded startups, yes it is. It is also an environmental concern, imagine if 80% of the web was running on ruby.

Re:PHP in 2019 by cntainer on Wednesday May 15, 2019 @08:23AM (#19918676)
Well if 80% of the web was running on ruby there wouldn't be any difference.

Most people don't understand that 99% of performance issues are not caused by language performance but by bad architecture and bad developers.

Always choose the best tool for the job, you rarely get to that scale and quality of software design that only the raw language performance is left to be optimized :)

Re:PHP in 2019 by smolder on Wednesday May 15, 2019 @09:35AM (#19919232)
There absolutely would be a difference. IME, people take this "performance is not a major concern when choosing a stack" thing a little too far and apply it too broadly, often without ever having benchmarked anything. When I can handle 300+ requests per second in one implementation and only 50 in another on the same hardware, that's going to be a big difference in costs that matters for everyone except fledgling businesses. I've seen 5-10x differences in performance between languages with none of it being attributable to anything the programmer did being suboptimal --just the language/standard libraries/runtime.
Re:PHP in 2019 by cntainer on Wednesday May 15, 2019 @10:02AM (#19919455)
I agree with your costs argument, but my point is you can rarely blame the language. If we bring the frameworks in the discussion it gets even more complicated.

If you build a Rails or Laravel app in the same way you would build a Java app, the Rails/Laravel app will be dead slow. And I've seen that happen. But if you know what you're doing you with Rails/Laravel it will be a long time before you say: we should rewrite this in Go/Rust/Erlang.

The main criteria for me when choosing a tool for the job is: how well does the team know the tool? can they use it at full potential?

I've been involved in java project with 20k monthly cloud costs. Most of the workload is handled in the background by consumers that pull messages from RabbitMQ. I'm pretty sure I could rebuild that with any language while actually reducing the costs because the bottleneck is not the code but the architecture. Would it matter if I would rewrite it in Java instead pf Python or Ruby, in terms of performance, yes, if we need to consider other things, like speed of development, etc it gets complicated again. :)

Re:PHP in 2019 by cutler on Saturday May 18, 2019 @06:15AM (#19946642)
5x-10x differences only exist between statically compiled and dynamically compiled languages. The differences in performance between dynamic languages is marginal. As for Ruby it's now slightly faster than Python for most things except C-based numerics.
Re:PHP in 2019 by smolder on Wednesday May 29, 2019 @09:25AM (#20039847)
When you start mixing in things like random number generators, different methods of string manipulation, different data structures and so on, there can be pretty dramatic differences in performance within each category. (static or dynamic) Every language has building blocks that come with it that are far from equal.
Re:PHP in 2019 by return1 on Wednesday May 15, 2019 @08:32AM (#19918734)
Tbh most of it is wordpress, and that is not terribly inefficient.
Re:PHP in 2019 by cntainer on Wednesday May 15, 2019 @09:09AM (#19919000)
I haven't touched wordpress in 8 years, but with old codebases you always inherit a lot of bad design decisions that always have an impact on general performance.

Maybe the wordpress guys have done a great job in rewriting the internals and cleaning things up in the last years, I wouldn't know, I don't follow their progress.

Re:PHP in 2019 by justaaron on Wednesday May 15, 2019 @07:49AM (#19918457)
Re:PHP in 2019 by bin0 on Wednesday May 15, 2019 @08:57AM (#19918916)
Your parent comment has a point about performance; I don't see why he is downvoted. Crystal is cool, but it is still immature in terms of ecosystem, the language could change, limited library support, and most importantly, not many great engineers. Particularly not outside of the valley.

Performance is a concern for many people, and this is somewhat overlooked because of the number of people here who work for companies where scaling is the primary concern. I think this is what he meant by people outside of VC-backed startups. I know of multiple companies that have had outrageous cloud-hosting bills and have had to hire fancy consultants to fix it.

Re:PHP in 2019 by justaaron on Wednesday May 15, 2019 @10:20AM (#19919616)
I simply meant that Crystal lang features ultra high performance, and yet shares much of Rubys syntactical elegance. Much is built into the standard library and I have to ask what your experience with Crystal has been like so far? I find pretty much everything I need, and the easy FFI with C takes care of most of the rest (see the Mongo.cr wrapper for the C mongo driver, for example...)
Re:PHP in 2019 by bin0 on Wednesday May 15, 2019 @05:13PM (#19923822)
I agree with that assessment. My experience has been reading a good bit into it. I considered learning it a few months ago, but wanted to focus on things that people were currently hiring for. Maybe at some point I will learn more, but I am a bit too broke right now to spend that much time on something that doesn't pay. I don't say that to be disparaging, it goes back to my point about it being immature and not having many engineers or companies using it.
Re:PHP in 2019 by justaaron on Wednesday May 15, 2019 @07:50AM (#19918463)
despite it's pre 1.0 status it's arguably more production ready than php ever was/will-be etc.
Re:PHP in 2019 by qaq on Wednesday May 15, 2019 @08:13AM (#19918611)
I bet you rely on things written in PHP way more than you realize.
Re:PHP in 2019 by golfer on Wednesday May 15, 2019 @09:13AM (#19919028)
Exactly. See: Wikipedia, Facebook, WordPress, etc. People talk crap about PHP but it is a workhorse of the web.
Re:PHP in 2019 by justaaron on Wednesday May 15, 2019 @10:25AM (#19919678)
indeed. this is largely legacy, but good luck changing that. I can't say that i miss it much, but then I don't work for either of these 2 entities. I'm familiar with what you are speaking about, so I don't think the lack of respect stems from a general ignorance of what you are referring to. It's rather people who have interacted with PHP in the past and didn't enjoy the experience.
Re:PHP in 2019 by golfer on Wednesday May 15, 2019 @01:21PM (#19921645)
That's a fair point.
Re:PHP in 2019 by justaaron on Wednesday May 15, 2019 @10:23AM (#19919648)
I'm familiar with the usage stats on wordpress, lol. I can't say that this is a good thing, but if it suits your needs, have at it.

I see no reason to start any greenfield project in 2019 in PHP unless you literally only know or ever want to learn PHP. I could be wrong in terms of the entire language and it's ecosystem could have changed in the 18-20 years since I deliberated interacted with it last... We have a lot of things since mod php, so there's many other options, most of which don't involve PHP, so I suppose true fans will build their web apps in forth, I dunno...

Re:PHP in 2019 by toredash on Thursday May 16, 2019 @11:47AM (#19930053)
My main beef with PHP is performance at scale. Doing 100.000+ req/s, the memory footprint for PHP is ... annoying.