News for hackers. Stuff that matters.
Re:Facebook releases HHVM, 60 percent faster than its curren... by afsina on Tuesday December 13, 2011 @10:41AM (#3347794)
Re:Facebook releases HHVM, 60 percent faster than its curren... by EricBurnett on Tuesday December 13, 2011 @12:19PM (#3348243)
Ignoring the fact that these are all running on the standard PHP interpreter, not one of Facebook's creation...

The benchmarks linked ran on a 4 core machine with varying amounts of parallelism, generally with Java being more parallelized. When running a server farm, as Facebook does, aggregate CPU time is more important than wall time^, since one can easily scale the number of processes to fit the machine. By CPU time the difference is down a factor of two at least, possibly more.

Be careful with benchmarks. They distill a comparison into a single value for easy use, but it's not going to be the most appropriate metric in all cases.

^So long as wall time is "sufficiently small", which it generally is.

Re:Facebook releases HHVM, 60 percent faster than its curren... by igouy on Tuesday December 13, 2011 @01:17PM (#3348534)
> a 4 core machine with varying amounts of parallelism

Let's force the programs onto one-core.

http://shootout.alioth.debian.org/u32/php.php

> aggregate CPU time is more important than wall time

Both CPU secs and Elapsed secs were shown.

> Be careful with benchmarks. They distill a comparison into a single value for easy use, but it's not going to be the most appropriate metric in all cases.

afsina pointed to a program-by-program comparison - not something distilled down to a single value.

Re:Facebook releases HHVM, 60 percent faster than its curren... by papaf on Tuesday December 13, 2011 @02:03PM (#3348711)
Meta comment: HN is becoming an incredibly sad place when the developer of the shootout benchmark site makes a technically valid and polite point - and people mark him down simply because they don't agree with it.

And the irony is the shootout site is written in PHP - so its not like he is especially biased against it.

Re:Facebook releases HHVM, 60 percent faster than its curren... by SomeOtherGuy on Tuesday December 13, 2011 @01:08PM (#3348492)
So check the single core version: http://shootout.alioth.debian.org/u32/benchmark.php?test=all...

Oh look, PHP is still 30 times slower than java. A 60% improvement to that still won't get it within an order of magnitude. And PHP is not significantly faster or easier to develop in than java, so you are losing execution speed to gain nothing.

Re:Facebook releases HHVM, 60 percent faster than its curren... by j_col on Wednesday December 14, 2011 @05:37AM (#3351352)
> And PHP is not significantly faster or easier to develop in than java...

Yes it is easier and faster to develop in (speaking as someone who has done both commercially). Examples of productivity gains:

1. No need to compile your code. Build cycle vastly improved (no time wasted with Ant/Maven/take your pick).

2. Less verbosity.

3. No need to restart your web server every time you deploy some new feature, just hit F5 on your browser and your done.

4. No classpath/jar file fun to slow your down.

5. You can hack a code fix in situ on a dev/server (or production if your brave/insane, I did say hack!). All you need is SSH.

6. Connecting to a database is trivial, support for most databases build in (no messing about with JDBC).

7. Deployments are a breeze: just drop the source code on your server, and you're done.

I could go on.

> so you are losing execution speed to gain nothing.

I wouldn't call a much faster development cycle "nothing", and if you understand Facebook's culture of "move fast" as laid down by Zuckerburg, they value development time higher than execution time (and rightly so).

* Edited to add line returns.

Re:Facebook releases HHVM, 60 percent faster than its curren... by blibble on Wednesday December 14, 2011 @09:26AM (#3351893)
if you've done Java commercially you've used sub-par tools.

1. any decent IDE will compile as you type

2. I'll give you this one

3. Java supports dynamic class reloading, it works out of the box with jetty.

4. you just press "run" in the ide.

5. same applies to java, just requires you take your (automatically built) .class file

6. I'm not sure how difficult you think JDBC is.. you just give it the connection string and the driver name.

7. just drop the war into your servlet directory, and you're done

Re:Facebook releases HHVM, 60 percent faster than its curren... by j_col on Wednesday December 14, 2011 @10:39AM (#3352190)
> if you've done Java commercially you've used sub-par tools.

I spent 3 years doing Java on large-scale telco projects using IntellJ, I'm not an amateur Java dev. I now code PHP full-time on a social network.

> 1. any decent IDE will compile as you type

Fine, but my original point was about building for a production environment.

> 2. I'll give you this one

Thanks!

> 3. Java supports dynamic class reloading, it works out of the box with jetty.

You using Jetty with dynamic class loading enabled in production?

> 4. you just press "run" in the ide.

Once again, your local dev environment has nothing to do with production servers (where you obviously won't have an IDE).

> 5. same applies to java, just requires you take your (automatically built) .class file

And what if that .class file is buried in a .jar somewhere, which is in turn buried in a .war somewhere else? Not quite as easy as opening a .php file with vi on the terminal, is it?

> 6. I'm not sure how difficult you think JDBC is.. you just give it the connection string and the driver name.

...and the driver has to be on the class path, and the driver might have local binary dependencies (depending on the vendor), and you have to be careful to ensure that you are using the correct driver .jar version for your version of the database, and ensure that it is packaged up will all of your other project dependencies when you build your .war/.ear etc.

> 7. just drop the war into your servlet directory, and you're done

...after you have built the .war using a build technology like Ant or Maven (I refer you back to my original point 1 about the Java build/deploy cycle being more complex).

Re:Facebook releases HHVM, 60 percent faster than its curren... by blibble on Wednesday December 14, 2011 @12:15PM (#3352605)
so the war is just built trivially by the IDE when you use a webapp type project. no messing around with the classpath as the war contains all dependent jars.

if you want clean builds you set up something like jenkins (with the automatically generated exported build files).

1) and 3) I was referring to development, you can just code away and hit F5 to see your results the same way in Java you can with PHP.

wrt database jars/binaries: a modern IDE does this all for you too, and is all output into the target war.

Re:Facebook releases HHVM, 60 percent faster than its curren... by SomeOtherGuy on Wednesday December 14, 2011 @09:37AM (#3351948)
You could go on? You are at 1/7 so far, perhaps you should quit while you're ahead. How many decades ago were you developing in java professionally? You don't manually build your code, you don't restart your development web server, are you doing your java development in notepad or what? I've been the sysadmin for big java projects, and a developer on them. I've never had any problems with DB access or "classpath/jar file fun" or deployment in either role. I genuinely have no idea what you are even talking about with the "classpath/jar file" thing, it honestly sounds like something someone who has never used java before might make up.

The only valid point you have is that java is slightly more verbose. But of course, it also prevents a number of bugs that slip into PHP code bases, which I find balances it out. And keep in mind, this is coming from someone who finds java offensive, and refuses to use it any more. You're not dealing with someone who is in love with java, but rather someone who thinks java is a terrible language that should never have been made. It is simply not as bad as PHP.

Re:Facebook releases HHVM, 60 percent faster than its curren... by maratd on Tuesday December 13, 2011 @01:49PM (#3348645)
Java is a compiled language. PHP is not. If you need to do a benchmark to realize that a compiled language is faster than its dynamic counterpart, then I really don't know what else to say to you.
Re:Facebook releases HHVM, 60 percent faster than its curren... by fleitz on Tuesday December 13, 2011 @02:59PM (#3348953)
Some compiled languages are faster, some aren't. Speed of execution is largely related to the optimizations the interpreter / compiler can do, and in many practical cases the qualities of the default library. The other problem is that many interpreted languages are implemented in C leading to the usual performance implications of inner-platform effect. Another problem is the underlying CPU architecture, the vast majority of CPUs are designed to execute C-like languages.
Re:Facebook releases HHVM, 60 percent faster than its curren... by afsina on Tuesday December 13, 2011 @03:42PM (#3349166)
What is your point? That does not chance the fact that using Php for a huge site like Facebook is a poor choice. A very poor choice indeed. They must be wasting energy on hundreds of servers because of this choice. One can hope that they are using Php only for the very basic front-end operations otherwise they are royaly screwed.
Re:Facebook releases HHVM, 60 percent faster than its curren... by SomeOtherGuy on Wednesday December 14, 2011 @09:19AM (#3351867)
I don't know why you are saying anything to me since you are responding to something I didn't say and that has nothing to do with the post I made. Is "dim witted attempts to respond to poorly thought out strawmen" really the level of discourse here?
Re:Facebook releases HHVM, 60 percent faster than its curren... by maratd on Wednesday December 14, 2011 @02:31PM (#3353228)
What? Who are you responding to?
Re:Facebook releases HHVM, 60 percent faster than its curren... by SomeOtherGuy on Thursday December 15, 2011 @08:59AM (#3356114)
You. You may want to consider that if there's two replies to your post, and both are "your post is entirely irrelevant", then perhaps your post genuinely is entirely irrelevant. Protip: read the whole thread from the top.
Re:Facebook releases HHVM, 60 percent faster than its curren... by maratd on Thursday December 15, 2011 @09:15AM (#3356178)
Where did I say "dim witted attempts to respond to poorly thought out strawmen" or "your post is entirely irrelevant"? Either you're confusing me with someone else or you don't understand the concept of quotes.
Re:Facebook releases HHVM, 60 percent faster than its curren... by SomeOtherGuy on Thursday December 15, 2011 @11:51AM (#3356854)
Again, read the entire thread. I am not confusing you with anyone else, and I understand the concept of quotes. You are failing to grasp the context of posts, and assuming everything anyone puts in quotes must be a statement you made. There are other people who post, why on earth would you think "your post is entirely irrelevant" is something I claim you said? I very clearly pointed out that two people replied to you saying that your post is irrelevant.
Re:Facebook releases HHVM, 60 percent faster than its curren... by maratd on Thursday December 15, 2011 @01:59PM (#3357408)
> I very clearly pointed out that two people replied to you saying that your post is irrelevant.

So you're just repeating what other people said? To make yourself feel better? Still a bit confused.

Re:Facebook releases HHVM, 60 percent faster than its curren... by SomeOtherGuy on Friday December 16, 2011 @09:30AM (#3360778)
>Still a bit confused

Clearly that is not a situation I can remedy for you. I suggested you read the thread, as that would resolve the confusion for anyone with basic reading comprehension skills. If that is not sufficient for you, then you'll need to ask an adult to explain the words you don't understand.