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" <[EMAIL PROTECTED]> wrote in message
01052316515004.00599@chrisbig">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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]