Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60703 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54916 invoked from network); 1 Jun 2012 06:11:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jun 2012 06:11:19 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.153 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.153 smtp153.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.153] ([67.192.241.153:49117] helo=smtp153.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 26/43-45898-60D58CF4 for ; Fri, 01 Jun 2012 02:11:19 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp25.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 1603A2D0295; Fri, 1 Jun 2012 02:11:16 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp25.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id A10E22D025A; Fri, 1 Jun 2012 02:11:15 -0400 (EDT) Message-ID: <4FC85D03.1080009@sugarcrm.com> Date: Thu, 31 May 2012 23:11:15 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Tom Boutell CC: PHP Internals References: <55e590f078f22ca2bbe10d5187cd3d84.squirrel@www.l-i-e.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] php interpreter From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > I've seen this statement before about the impact of caching the actual > compilation (or mere tokenization?) to bytecode being very small > compared to the impact of avoiding disk access. I am curious if there > are any measurements breaking this down. Read-only access to code in > files already buffered by the OS (not files read for the first time) > ought to be very fast. We did some measurements a long time ago at Zend, but I don't have the numbers right now and anyway the engine changed so much since then they are probably irrelevant anyway. However, the main gist is right - time saved on compilation is not that much. One of the reasons to that is that some of the data structures that are used by the engine are dynamic (class tables, class variables, static variables, etc.) which means a lot of data needs still to be handled to make script stored in SHM runnable. Which greatly decreases savings from not compiling it. The disk read however is still saved, and since unlike compilation it's a system call and talks to potentially very slow (compared to memory) device, the savings are significant. Even with OS cache, you still have context switches and copying the data, etc. With some work I think it is possible to make PHP script to run with zero system calls spent on loading script files. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227