Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64059 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99278 invoked from network); 27 Nov 2012 05:03:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Nov 2012 05:03:39 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.210.170 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.210.170 mail-ia0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:42624] helo=mail-ia0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A9/B3-11726-AA944B05 for ; Tue, 27 Nov 2012 00:03:38 -0500 Received: by mail-ia0-f170.google.com with SMTP id x24so9643179iak.29 for ; Mon, 26 Nov 2012 21:03:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:x-originating-ip:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=UTskshMJvrERSpWpDew/PI2rbKjQK+LQobRNBNADw60=; b=cftaWNvJpzKzy7PjlYdK7LEsWYXfuMUSZNiAZ6a1CNhQw+1DWdgnaFi2Bv/opH+Xd1 nIZcN6Yl7Cm6bOH2jUM1cQfmU/qkND1JUtVcmM4soS6Ap0cMQM9exlQJ2r6E0rNceWdM 5Z170Q96SSYqi5Wx+atosBQzgt7LXHCo2uqJjDO+yumcxoWy1no6bsWL8JAixz9Rx+Wc Om24due6gV/8KN2n4zYZNik9bB+xOOcGELvX+W0ue04mMST3JKiSwJ6xKNPcXcpWNOTz JNCLKboRBXDAn2SqNUfsCcXDsrYydu5YP8E4bYwAserC9g3A9uxYKA4UOJ3RLV1rQM0d 912Q== MIME-Version: 1.0 Received: by 10.50.152.194 with SMTP id va2mr14314850igb.25.1353992615644; Mon, 26 Nov 2012 21:03:35 -0800 (PST) Sender: php@golemon.com Received: by 10.64.21.193 with HTTP; Mon, 26 Nov 2012 21:03:35 -0800 (PST) X-Originating-IP: [98.210.180.187] In-Reply-To: <50B41783.90104@lerdorf.com> References: <50B41783.90104@lerdorf.com> Date: Mon, 26 Nov 2012 21:03:35 -0800 X-Google-Sender-Auth: uq0lsSLKaKQROtUCQYE5RTi2Gm0 Message-ID: To: Rasmus Lerdorf Cc: Raymond Irving , PHP Internals Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkSV7v7iy+HUYHa3t7MBArlv6kiGoN+JD/XVOZnoaa8+WsTVlAKERPKpftvY16qjkgP5v9t Subject: Re: [PHP-DEV] HHVM and PHP From: pollita@php.net (Sara Golemon) >> I've being reading about HHVM and the numbers are looking great but I was >> just wondering if we will we ever see something like HHVM being added to >> the PHP core? > > No, not likely. Maybe an LLVM-based JIT one day, but the HHVM approach > is not something any of us are looking at. > To echo Rasmus' reply: No. HHVM is a reimplementation of the PHP language from the ground up, so logically speaking "adding it to the PHP core" doesn't actually make sense. They're different birds from the get-go. PHP could adopt a similar strategy of translating bytecode to native machine code (again echoing Rasmus' reply), but that would be a large undertaking by itself, and adapting zval unions to static type analysis is a whole other layer of complexity beyond that. The important thing to keep in mind is what each implementation is good at, and what it's not. As the maintainer of the OSS version of HipHop (HHVM), I'll be the first to admit that the official PHP engine and runtime have a broader range of platform/architecture support, and stronger community, and a larger library of extensions and functionality behind it. Also, because of it's lifecycle design, PHP outperforms HHVM on single-run command-line scripts. On the other hand, HHVM does outperform Apache+PHP for web requests quite well. Facebook would need at least 5x as many web-servers (and we use a lot as it is) if we were using normal PHP. That's not to say PHP isn't fast, but interpreted bytecode using loose typing will never keep pace with native machine code and strict typing. Standard Disclaimer: Yes, front-end CPU time isn't the end-all be-all of optimization. You should always start with your data access layer and the efficiency of the scripts you write. -Sara P.S. - I do disagree with Rasmus' statement about none of us looking at fitting a JIT into PHP. ;)