Live data from Hacker News

PHP 7 deployment at Dailymotion

engineering.dailymotion.com

111–120 of 166 posts

Re: PHP 7 deployment at Dailymotion

#111
post #12

I used to run one of my site (25K unique visitors a day) on PHP 5.3, when HHVM came out with stable version I shifted to HHVM and I had similar experience. Now I am running it on PHP 7 and I have to say I am more than happy with results. As much as PHP is not cool for today's developers it has served on some really high traffic sites and stayed useful even with the test of time. P.S. Now I wish somebody just implemen…

Can you explain the draw of Async I/O? A single request will not be faster, but you may get more concurrent requests going due to running some while some are waiting for I/O to finish? Is that correct?

When you start talking about multiple concurrent connections, and considering performance of an application as a whole, Async I/O at the application level offers basically no speed benefits over any kind of Sync I/O runtime that can run in parallel.

What an Async I/O model can do is allow the amount of resources consumed by parallel execution contexts to be reduced - therefore allowing you to service more concurrent requests in parallel. But not necessarily any faster, if I/O is your bottleneck in the first place.

It can also be used to give more predictable performance under loads with i.e. response times, if the responses are not dependent on I/O operations to complete.

Re: PHP 7 deployment at Dailymotion

#112
post #23
post #9

Earlier quoted context omitted.

At least this one isn't ripping it to shreds (so far). The other discussion...that was rough to read as a PHP dev.

Take the attacks with a grain of salt, although many of the criticism is true, it is not exclusive to PHP, ex. the unexpected type coercions. OTOH, most of the performance benchmarks done against PHP (ex. PHP vs Python) usually mean "which language is faster at crunching numbers". I/O operations like reading a file from disk or running a query against a database are an order of magnitude slower than number crunching,…

To be fair, "number crunching" starts to become really important when you need to, oh, work with the large set of data that you pull back from the database.

But in saying that, PHP7 is actually pretty fast. Probably faster than CPython for most of the algorithmic tasks you might run with data from a SQL database, for example.

Re: PHP 7 deployment at Dailymotion

#113
post #14

Hack and HHVM solves what is, IMO, the worst feature of the default PHP runtime environment[0] - and that is the superglobals. It wasn't mentioned in the post from Slack, but default superglobals and the earlier register_globals design decisions are the worst and most impactful wart in PHP. Because it was designed as a templating language, the default web server interface, which is CGI - will auto-expose all variable…

> In other languages you can't get that without using a standard library that will escape the values by default

Not sure what you mean by that. (As far as I know) you can do the same thing in e.g. Python with Flask:

    cursor.execute("SELECT * FROM username_list WHERE %s" % request.form['username'])

Re: PHP 7 deployment at Dailymotion

#114

Earlier quoted context omitted.

>PHPs reputation seems to surround the fact that it tends to be (or was) the first language amateur coders dabbled with. That's certainly part of it. JavaScript suffers the same hate today -- amateur and junior developers produce thousands of lines of crap per year, and people blame it on the language. But PHP itself is just a mess. I'm an experience developer (about 30 years at this point), and about 12 years ago I…

>JavaScript suffers the same hate today.. The difference between Php and Javascript is that Javascript have competent people driving it forward. Php is still developed by college students with no real world programming experience, in their spare time.... Downvotes? Don't think this is true? See the following. These are couple of most prominent people working in the language. [1] https://nikic.github.io/aboutMe.html […

Not impressed by your comment at all. If you think that the age of Nikita Popov or Andrea Faulds is any indicator of their "competence" I suggest you actually take a look at their contributions.

Re: PHP 7 deployment at Dailymotion

#115

Earlier quoted context omitted.

> I'm an experience developer (about 30 years at this point), and about 12 years ago I decided to do a volunteer project for a nonprofit in PHP > mysql_xxxx functions So, you used PHP 12 years ago and comment based on that. You have a point though. I used this internet thing about 17 years ago, it was terrible. Only dial-up. SLOW! And don't talk to me about browsers. Netscape? Internet Explorer? Ugh. Forget it. I don…

>You have a point though. I used this internet thing about 17 years ago, it was terrible. Only dial-up. SLOW! And don't talk to me about browsers. Netscape? Internet Explorer? Ugh. Forget it. I don't care what they might have changed, or replaced or completely removed, its always terrible. We have only one Internet. But we have a lot of alternatives for Php to choose from. If you have an Internet provider that gave y…

After 12 years? I wouldn't consider them to be the exact same as when I left them at least.

Re: PHP 7 deployment at Dailymotion

#116

Earlier quoted context omitted.

comparing "simple java app" to something as complex (overly? needlessly in some cases? sure) as magento is nowhere near apples and oranges. compare it to broadleaf or konakart, maybe. I've no doubt java will probably still be faster, but it won't be 500 rps vs 3 rps.

Except I have built Java apps that did the same kind of things as Magento, and yes it really was 500 to 3.

Benchmarks or no you haven't.

Re: PHP 7 deployment at Dailymotion

#117
post #80
post #57

Earlier quoted context omitted.

You are missing the forest for the trees. The statement I made is that more consistent and "opinionated" languages encourage better code. They don't enforce it, just encourage it. It is my opinion that this is valuable. I did define "good", internally consistent languages with strong guidelines for developers. I made no statements about mature PHP codebases as they are irrelevant to my argument. I do accept that peop…

> Nitpicking individual points whilst misconstruing what I said is neither useful or appreciated. It wasn't my intention, I'm sorry if my comment came off as nit-picky. I wasn't trying to misconstrue your comment, I genuinely did not get your argument (I think I now get it, thanks to your reply).

No problem, I also wasn't as cordial as I could have been.

Re: PHP 7 deployment at Dailymotion

#118
post #96

Earlier quoted context omitted.

If you know C, you can identify pretty well what are the (thin) PHP wrappers around the C routines. Java influenced the OO design, so you know where to find it, and Perl is mostly, well, PCRE. It's not consistent, but it's not _that_ hard to navigate.

Well, It is not that easy. For example, take the function strlen(). You can see that it is a wrapper for the C function. So can you expect that it will behave like the c function, accepting strings only? No! It now accept both strings and integers. So you have part perl there. Now take another function. ctype_digit(). I don't know where the name come from. You expect it to behave like strlen() accepting both strings…

It's more about automatic type conversion than the API, though; numerics magically get converted to strings and vice-versa. This is convenient in some cases, especially for beginners who don't have to think about types, but it eventually bites you if you never realize what happens in your back.

Re: PHP 7 deployment at Dailymotion

#119

Earlier quoted context omitted.

>JavaScript suffers the same hate today.. The difference between Php and Javascript is that Javascript have competent people driving it forward. Php is still developed by college students with no real world programming experience, in their spare time.... Downvotes? Don't think this is true? See the following. These are couple of most prominent people working in the language. [1] https://nikic.github.io/aboutMe.html […

Not impressed by your comment at all. If you think that the age of Nikita Popov or Andrea Faulds is any indicator of their "competence" I suggest you actually take a look at their contributions.

My comment just said that they are just college students. And the links are to prove that. Those are just facts. I don't know why people are pissed.

Edit: It is not just their age. I have seen their contributions (RFC's and implementations) and had conversations with them. And my opinion is also based on that...

Re: PHP 7 deployment at Dailymotion

#120
post #71

Earlier quoted context omitted.

You can make low-quality software in any language, PHP just happens to be easier to pick up.

This is the most pernicious and annoying technicality that advocates of low-quality languages invoke. PHP does not actively work against bad or just plain wrong code, and its construction actively encourages bad code. It's missing aspects that we know to be tremendously useful for writing high-quality correct code. You can write low-quality software in e.g. rust, but you're going to work a lot harder at it. Rust (aga…

So, I generally don't wade into this argument. I've been programming for 27 years, 12 of that professionally. In that time I've used a lot of languages for a lot of projects. Every language is capable of being used to shoot yourself in the foot TBH. The hate that PHP gets is, IMHO, mostly from the fact that it's a gateway language and as such often has a higher WTF per minute rate for the code you find than many other languages. Anyway, on to what made me post this.

> its construction actively encourages bad code

That's a statement that needs a reference to back it up.

Post reply on HN