Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28295 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12034 invoked by uid 1010); 8 Mar 2007 14:18:43 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 12019 invoked from network); 8 Mar 2007 14:18:43 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Mar 2007 14:18:43 -0000 Authentication-Results: pb1.pair.com header.from=news@sea.gmane.org; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php-php-dev@m.gmane.org; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain m.gmane.org designates 80.91.229.2 as permitted sender) X-PHP-List-Original-Sender: php-php-dev@m.gmane.org X-Host-Fingerprint: 80.91.229.2 main.gmane.org Linux 2.5 (sometimes 2.4) (4) Received: from [80.91.229.2] ([80.91.229.2:60570] helo=ciao.gmane.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/7E-22209-F3B10F54 for ; Thu, 08 Mar 2007 09:18:41 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HPJRs-00029C-LW for internals@lists.php.net; Thu, 08 Mar 2007 15:18:28 +0100 Received: from bi01p1.nc.us.ibm.com ([129.33.49.251]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Mar 2007 15:18:28 +0100 Received: from pmuellr by bi01p1.nc.us.ibm.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Mar 2007 15:18:28 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: internals@lists.php.net Date: Thu, 08 Mar 2007 09:18:16 -0500 Lines: 30 Message-ID: References: <45EF4210.8000709@lerdorf.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: bi01p1.nc.us.ibm.com User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221) In-Reply-To: <45EF4210.8000709@lerdorf.com> Sender: news Subject: Re: [PHP-DEV] PHP Just-In-Time Compiler From: pmuellr@yahoo.com (Patrick Mueller) Rasmus Lerdorf wrote: > This comes up once or twice a year. The machine code you compile to is > going to end up looking a lot like the current executor since you don't > have strong types to help you optimize anything. You'd still need to > pass the unions around and do runtime type juggling and all the overhead > that comes along with that. Strict typing is not required for JIT-level optimization. See: Smalltalk, Self, Strongtalk, Tamarin. The Strongtalk guys, who have a stricter-than-usual typed Smalltalk implementation, and a pretty good JIT, actually ignore the type information during JIT analysis. > The idea behind PHP from day one was that it was an environment for > wrapping compiled code. Things that are performance critical is written > in C/C++ and things that aren't are left in the PHP templates. Whether > you issue an SQL query from PHP or from a compiled C program doesn't > affect the overall performance of the system so you might as well do > that from PHP. And since day one, people have been building big ole PHP libraries ... :-) For someone seriously interested in looking into this, there are some 'free' JITs available from the following projects: Apache Harmony (an Apache licensed J2SE implementation), StrongTalk (Smalltalk), Adobe Tamarin (recently donated to Mozilla), and Sun's HotSpot (Java; curiously, HotSpot was based on StrongTalk!). -- Patrick_Mueller@us.ibm.com IBM PHP Community Architect, IBM Research Triangle Park