Re: ignored patches

From: Date: Tue, 04 Dec 2007 00:42:47 +0000
Subject: Re: ignored patches
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-33618@lists.php.net to get a copy of this message
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: <?php $measurements = array(); $_GET += array("includeFileCardinality" => 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 "
        <form>
            Az egyesével include-olt fájlok száma:<br>
            <select name=\"includeFileCardinality\" size=\"5\">
                <option value=\"1\">1</option>
                <option value=\"2\">2</option>
                <option value=\"3\">3</option>
                <option value=\"4\">4</option>
                <option value=\"5\">5</option>
                <option value=\"6\">6</option>
                <option value=\"7\">7</option>
                <option value=\"8\">8</option>
                <option value=\"9\">9</option>
            </select><br>
            <input type=\"submit\" value=\"Teszt\">
        </form>
    ";
} function displayMeasurments($title, $measurements) {
    $fastestTime = min($measurements);
    echo "<table border=\"1\">\n<tr><td colspan=\"3\"
align=\"center\"><strong>".$title."</strong></td></tr>\n";
    foreach($measurements as $testMethod => $elapsedTime)
    {
        echo "<tr><td>".$testMethod."</td>\n";
        echo "<td>".$elapsedTime."</td>\n";
        echo
"<td>".round($elapsedTime/$fastestTime*100)."%</td></tr>\n\n";
    }
    echo "</table>\n<br>";
} ?> 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ő

« previous php.internals (#33618) next »