Print or Echo takes lots of time
| From: | Sancar Saran | Date: | Mon, 25 Sep 2006 12:11:47 +0000 |
| Subject: | Print or Echo takes lots of time | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-242185@lists.php.net to get a copy of this message | ||
Hi,
When I was check the performance of my system I found interesting resuts.
My code stores html output into a variable. When page creation complete I
printed out the variable.
Problem was generation html code takes 0.5 second and just
echo $strPage takes 2.0 or more second.
my code structure was.
$strPage = "<html> yada dayda";
...
$strPage.= " another html tags";
...
$strPage.= getSqlDataAndCreateSomeHtmlCOde();
...
end of page creation.
Current Total execution time 0.5 seconds.
print $strPage;
Current Total execution time 2.5 seconds.
$strPage carries entire html structure (for example equal of 100K html code);
excluding the cookie and other kind of header transfers and error messages,
there was no print or echo command was submitted.
Is there any idea about this latency and any idea to find problem...
Regards
Sancar Saran