[PLUG] Facebook & PHP - massive speedup

wes plug at the-wes.com
Fri Feb 5 00:10:52 UTC 2010


On Thu, Feb 4, 2010 at 3:36 PM, Randal L. Schwartz <merlyn at stonehenge.com>wrote:

> >>>>> "Carlos" == Carlos Konstanski <ckonstanski at pippiandcarlos.com>
> writes:
>
> Carlos> Absolutely agree with Wes. There are a host of commonly-used
> Carlos> interpreted languages today that are slow because they are
> Carlos> interpreted. BASH, perl, python, ruby, javascript, vbscript. Are
> more
> Carlos> examples needed? Let's see the list of counterexamples. FB is
> making
> Carlos> their PHP run faster by compiling it. Why would they do that if the
> Carlos> slowness of their interpreted language, and the benefit gained by
> Carlos> compiling it, is a myth?
>
> You're both wrong, but I'm not going to waste my time trying to convince
> you otherwise.
>
> The speed of a language has very little to do with "interpreted" or
> "compiled".  There's a lot more going on, far more variables than that,
> like
> whether the language has early or late binding, or expensive flexible data
> types.
>
> That's the myth I'm talking about.
>
>
I did state that "it's not strictly a compiled vs. interpreted issue" - you
are just re-explaining what I said. I am aware that a language being
interpreted does not make it slow, nor does compiling make it fast.
Nonetheless, most of the languages that are interpreted perform more slowly
than most of the languages that are compiled. With of course, no shortage of
exceptions.



> For example, bash's slowness is because it has to do a lot of forking.
> Nothing to do with "interpreted".  I could go down that list and explain
> each
> one of those.
>
> But I won't, because you've already made up your mind.
>
>
I haven't made up my mind about anything - I am drawing from observations of
experiences, both my own and others. I have seen a lot of evidence to
support my position, and rather little (but some) to contradict it.


> The fact that even after converting PHP to C++ only sped up the results by
> a
> factor of *2* should be ringing alarms at this point.  It's *NOT* the
> language.  It's *not* whether it's interpreted or compiled.
>

This doesn't make sense to me. Different languages implement the same
features and functions in different ways. Some of them are more efficient
for a given application than others. I realize I'm speaking in gross
generalizations here, as I am no more interested in changing your mind than
you are in mine. I'm just trying to convey that I do not believe I speak out
of ignorance.


>
> Besides, these days, we should be talking "results per programmer hour",
> because that's the most expensive part of the equation.
>
> It's the *real* reason Facebook is still coding in PHP, and not C++.  (Even
> though I think PHP was a bad choice.)
>
>
I made this point as well.

-wes



More information about the PLUG mailing list