Re: Web Server processing question
| From: | RockMonkey | Date: | Wed, 23 May 2001 16:13:42 +0000 |
| Subject: | Re: Web Server processing question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-54095@lists.php.net to get a copy of this message | ||
Ok. A simplified version of the subroutines (still with the same problem
though):
function SimpleList($Data,$MaxStats = "10",$Heading = " ") {
if (is_array($Data)) {
$Output = "";
$Output .= SimpleItem("$Heading","",2);
foreach ($Data as $Player => $Qty) {
$Output .= SimpleItem($Player,$Qty);
}
print $Output;
}
}
function SimpleItem($Left,$Right = " ",$Colspan = "") {
if (!empty($Colspan)) {
return("<tr valign='top'><td class='smaller'
colspan='2'>$Left</td></tr>\n");
}
return("<tr valign='top'><td
class='smaller'>$Left</td><td align='right'
class='smaller'><b>$Right</b></td></tr>\n");
}
That's all it does. During the tests, the array of data only contained 10
elements, and still some of the calls to this function took 10 seconds
"Christian Reiniger" <creinig@mayn.de> wrote in message
news:01052316515004.00599@chrisbig...
> In the following example, which is the one that I'm concerned about,
> the same function is called multiple times in a row (with nothing
> happening in between calls) for different "categories". Basically, the
> function sorts an array and outputs the 10 elements with the highest
> value.
>
> I ran the test several times, calling the function hundreds of times
> with the same data, and each time I ran the test every second call took
> thousands of times longer than the ones that ran ok.
Well, as it really alternates between fast and slow, there has to be some
"real" reason for it. Can you post some code?
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
/* you are not expected to understand this */
- from the UNIX V6 kernel source
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net