Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:33618 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81271 invoked by uid 1010); 4 Dec 2007 00:42:54 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 81256 invoked from network); 4 Dec 2007 00:42:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Dec 2007 00:42:54 -0000 Authentication-Results: pb1.pair.com smtp.mail=felho@avalon.aut.bme.hu; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=felho@avalon.aut.bme.hu; sender-id=unknown Received-SPF: error (pb1.pair.com: domain avalon.aut.bme.hu from 84.2.40.5 cause and error) X-PHP-List-Original-Sender: felho@avalon.aut.bme.hu X-Host-Fingerprint: 84.2.40.5 mail00a.mail.t-online.hu Received: from [84.2.40.5] ([84.2.40.5:52237] helo=mail00a.mail.t-online.hu) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 61/73-52978-C82A4574 for ; Mon, 03 Dec 2007 19:42:53 -0500 Received: from gergely-hodicskas-computer.local (office-vpn.jasminmediagroup.com [80.77.114.168]) by mail00a.mail.t-online.hu (Postfix) with ESMTP id 6131FAC958 for ; Tue, 4 Dec 2007 01:42:48 +0100 (CET) Message-ID: <4754A287.2060000@avalon.aut.bme.hu> Date: Tue, 04 Dec 2007 01:42:47 +0100 User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: "internals@lists.php.net" References: <4731278C.8020301@chiaraquartet.net> <4731F977.4080502@zend.com> <4753B087.4020206@chiaraquartet.net> <003601c83582$a1b16fc0$e5144f40$@mcnaught@synergy8.com> <4754807B.80408@zend.com> In-Reply-To: <4754807B.80408@zend.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] ignored patches From: felho@avalon.aut.bme.hu (Gergely Hodicska) Hi! > Can you provide some benchmark setups that this could be researched - > i.e. describe what was benchmarked and how to reproduce it? I have already played with this topic. If you don't have an opcode cache lazy loading is a good solution: it is worth loading a code only when it is needed. But if you have opcode cache it is worth to put often used includes into one big file. I used the following test code: 9); $_GET["includeFileCardinality"] = min(max((int)$_GET["includeFileCardinality"], 1), 9); $start = microtime(TRUE); if ($_GET["includeFileCardinality"] >=1) include_once("include.test/flash_config.php"); if ($_GET["includeFileCardinality"] >=2) include_once("include.test/access.php"); if ($_GET["includeFileCardinality"] >=3) include_once("include.test/awe_config.php"); if ($_GET["includeFileCardinality"] >=4) include_once("include.test/functions.php"); if ($_GET["includeFileCardinality"] >=5) include_once("include.test/domain_constants.php"); if ($_GET["includeFileCardinality"] >=6) include_once("include.test/categories.php"); if ($_GET["includeFileCardinality"] >=7) include_once("include.test/config.php"); if ($_GET["includeFileCardinality"] >=8) include_once("include.test/common.php"); if ($_GET["includeFileCardinality"] >=9) include_once("include.test/errorhandler.lib.php"); $measurements["include - tobb kulon fajl"] = microtime(TRUE)-$start; $start = microtime(TRUE); include_once("include.test/_all_in_one.php"); $measurements["include - egy nagy fajl"] = microtime(TRUE)-$start; if (php_sapi_name() == "cli") { echo serialize($measurements); } else { header("Content-Type: text/html; charset=UTF-8"); displayMeasurments("Eredmények apache modul esetén", $measurements); displayMeasurments("Eredmények CLI módban", unserialize(shell_exec("php ".__FILE__))); echo "
Az egyesével include-olt fájlok száma:

"; } function displayMeasurments($title, $measurements) { $fastestTime = min($measurements); echo "\n\n"; foreach($measurements as $testMethod => $elapsedTime) { echo "\n"; echo "\n"; echo "\n\n"; } echo "
".$title."
".$testMethod."".$elapsedTime."".round($elapsedTime/$fastestTime*100)."%
\n
"; } ?> The files come from a real life project. I get the following result: Results (apache module) include - more files 0.000619888305664 307% include - one big file 0.000202178955078 100% I run the test code a lot of time, I get this characteristics always. Then I tried the code on heavily IO loaded server (x100 req/sec+DB replica) and the difference was bigger (5-600%). Best Regards, Felhő