Live data from Hacker News

Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

phoronix.com

81–90 of 144 posts

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#81
post #68

I don't think PHP's main problem is speed. It's generally used for websites, and a few milliseconds aren't going to make a difference when pages are so bloated by JavaScript libraries to often be 5-10MB. PHP's problem IMHO is that I wouldn't be able to use it if it wasn't for autocomplete: inconsistent function names, inconsistent parameter order. The ecosystem is fine, there's Composer, PSR, Laravel. The problem is…

Stupid idea IMHO. PHP is great BECAUSE it organic growth. It fully exposes the incorporated libraries with the same naming convention of the library functions and often additionally also in ObjectOriented style. Have a look how green field planned ObjectOriented Namespaces in Java and dotNet Framework 1-4 turned out. Java's String vs StringBuilder vs StringBuffer, Java's deprecated Date and Time classes, the whole "o…

You can't tell me that the fact that the opposite of the `htmlentities` function is `html_entity_decode` is "great, easier to remember and quite sympathetic".

Of course you need great documentation, with those inconsistencies users have to look at it every 5 minutes to even know what they're doing.

EDIT: Thanks. https://github.com/nkkollaw/php/commit/eeb8d6b38272eadaae405...

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#82

I don't think PHP's main problem is speed. It's generally used for websites, and a few milliseconds aren't going to make a difference when pages are so bloated by JavaScript libraries to often be 5-10MB. PHP's problem IMHO is that I wouldn't be able to use it if it wasn't for autocomplete: inconsistent function names, inconsistent parameter order. The ecosystem is fine, there's Composer, PSR, Laravel. The problem is…

Really?

So the main issue with php is a few functions have inconsistent parameter order? Ignore the massive speed improvements, composer package manager system or huge community. Good companies use php. I haven't met someone at facebook that can't code it. (please spare me the HHVM comment or how your intern friend does haskell in the basement).

Have you read about python 2 vs 3? Have you actually seen real programming language issues? Or tried to scale rails? Or worked on deploying java with 30 other people? Tracked a memory leak in c++? Been thrown into callback hell of node? Have you tried to get stackoverflow answers while developing in MEAN.

IMHO people are just justifying their own stack (while secretly suffering with python - a 26 year old programming language) [1][2]. In reality they know php can do anything web / probably in less lines, portable, with easy to find information, with a strong community, in less time, faster. I will let everyone get back to figuring out what the difference between urllib and urllib2 is in python.

[1]https://wiki.python.org/moin/Python2orPython3 [2]https://stackoverflow.com/questions/2018026/what-are-the-dif...

PS. Also, wtf does javascript librarys have to do with php.

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#83
post #44

Honest, sincere, question here: How is programming in PHP these days? I haven't used the language since 4.x-5.2 or so. I wrote it off completely when Hack and HHVM came out due to the nuances between it and PHP proper (not to say either is bad, it was just another barrier, and set of choices I didn't care to deal with). I typically write Ruby, Elixir, and some JVM based languages these days. Any new features or langu…

PHP has some design decisions (e.g. shared nothing architecture) that used to be laughed about - nowadays it's obviously known as a big advantage - PHP can scale linearly with no overhead. [Edit: read what Slack devs wrote about PHP, their server side is written in PHP https://slack.engineering/taking-php-seriously-cf7a60065329 and beside that Facebook uses PHP/Hack and MySQL as core tech) The syntax is inspired by P…

Both Erlang (1986) and Beam (Erlang VM, 1992) predate PHP (1995).

And Elrang processes are not OS processes, though I get your main point.

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#84

it's really astonishing to see PHP still alive and kicking, despite all the backlashes it has received over the years. whatever it is they are doing, they must be doing something right.

Cheap Hosting + Wordpress = 40% of the internet.

PHP itself has absolutely nothing to do with this.

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#85
post #79
post #35

Earlier quoted context omitted.

The biggest grievances stem from PHP wanting to please you and convert things from one type to another even when it really, really shouldn't. Adding variadics in 5.6, return and scalar types in PHP 7 tunes down this sort of crazy. Not fully, though. String comparison is still broken -- use strcmp() and be happy. Using anything else is dark and full of terrors. Well, at least it's not transitive https://3v4l.org/goSYX…

Does PHP have linters or something that force you to use the practices you described? I find in Javascript that works pretty well to restrict the language to a sane subset.

You can use phpmd: https://phpmd.org/ or phpcs: http://cs.sensiolabs.org/

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#86

I don't think PHP's main problem is speed. It's generally used for websites, and a few milliseconds aren't going to make a difference when pages are so bloated by JavaScript libraries to often be 5-10MB. PHP's problem IMHO is that I wouldn't be able to use it if it wasn't for autocomplete: inconsistent function names, inconsistent parameter order. The ecosystem is fine, there's Composer, PSR, Laravel. The problem is…

Really? So the main issue with php is a few functions have inconsistent parameter order? Ignore the massive speed improvements, composer package manager system or huge community. Good companies use php. I haven't met someone at facebook that can't code it. (please spare me the HHVM comment or how your intern friend does haskell in the basement). Have you read about python 2 vs 3? Have you actually seen real programmi…

Well, I specified "IMHO". That's the main issue that I have with PHP.

I have no idea what they do at Facebook, and I don't have to work on the biggest community in the world that often.

The problems I encounter in term of performance for websites/apps are along the lines of pages being super-slow because of the 100 JavaScript frameworks we like to use nowadays for the smallest of projects, my clients uploading 10MB images that get resized via HTML and still load at full-resolution, etc.

As for coding yes—one issue I have is that not using PHP exclusively I get confused by the fact that the opposite of html_entity_decode is htmlentities and not html_entity_encode, and that slows me down for no apparent reason except the fact that 20 years ago one guy added htmlentities and another guy html_entity_decode, and no one thought about aliasing or deprecating one of the two to fix the unintuitive naming.

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#87

Earlier quoted context omitted.

PHP isn't serverless in the same way a lambda function is at all. You still need to host something that responds to HTTP requests and passes them along appropriately to PHP. Just because it has a share nothing model doesn't mean you don't need to provision servers. You still need to do 90% of the work.

I think he meant you can easily find $5 "unlimited" php web hosts. So for all intents and purposes it's serverless as in you can use it on a shared web host, where you do not have to manage the server because the hosting company does it. Not that it's literally serverless. Even lambda uses servers obviously. They just abstract it away which is what he meant. Clearly all cloud offerings are backed by servers, it's jus…

For $5 a month you can get a Linode VPS with 1GM RAM. After the one-off learning curve of Docker you can image these servers and get much more for your money than what any shared hosting provider has to offer. Better still, you're not tied to PHP either.

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#88

I don't think PHP's main problem is speed. It's generally used for websites, and a few milliseconds aren't going to make a difference when pages are so bloated by JavaScript libraries to often be 5-10MB. PHP's problem IMHO is that I wouldn't be able to use it if it wasn't for autocomplete: inconsistent function names, inconsistent parameter order. The ecosystem is fine, there's Composer, PSR, Laravel. The problem is…

Really? So the main issue with php is a few functions have inconsistent parameter order? Ignore the massive speed improvements, composer package manager system or huge community. Good companies use php. I haven't met someone at facebook that can't code it. (please spare me the HHVM comment or how your intern friend does haskell in the basement). Have you read about python 2 vs 3? Have you actually seen real programmi…

Do you have a public example that illustrates how PHP/Hack code in Facebook looks like?

My problem with PHP is that most of modern frameworks seem to take a lot from Java, and people have started to use type hinting whenever they can, so the code looks like (uglier) Java, but without advantages of performance (being made worse by having to setup everything on every request) or compile time type safety.

Re: Benchmarks of PHP 7.2 Beta: PHP Is Still Getting Faster

#89

Earlier quoted context omitted.

Really? So the main issue with php is a few functions have inconsistent parameter order? Ignore the massive speed improvements, composer package manager system or huge community. Good companies use php. I haven't met someone at facebook that can't code it. (please spare me the HHVM comment or how your intern friend does haskell in the basement). Have you read about python 2 vs 3? Have you actually seen real programmi…

Well, I specified "IMHO". That's the main issue that I have with PHP. I have no idea what they do at Facebook, and I don't have to work on the biggest community in the world that often. The problems I encounter in term of performance for websites/apps are along the lines of pages being super-slow because of the 100 JavaScript frameworks we like to use nowadays for the smallest of projects, my clients uploading 10MB i…

"As for coding yes—one issue I have is that not using PHP exclusively I get confused by the fact that the opposite of html_entity_decode is htmlentities and not html_entity_encode"

Ah yes. You will probably have to hit 'tab' on your IDE with php - to type "html_entity_encode". But if this is too hard - Here you go,

Try it out in python (careful of the 2/3 quirks!):

Python: https://stackoverflow.com/questions/275174/how-do-i-perform-...

Java: https://stackoverflow.com/questions/5741311/how-to-encode-sp...

Go: https://gist.github.com/brandonrachal/10605780

Rails: https://stackoverflow.com/questions/1600526/how-do-i-encode-...

c++ (get your own sax ready!): http://forums.codeguru.com/showthread.php?448809-C-Replacing...

Again the anti-php movement in action. A bunch of devs who used php 15 years ago.

Post reply on HN