Jump to content

Page load resources


RobertP

Recommended Posts

i am currently bench-marking my application. i am trying to see where i might have some heavily codded areas.

 

echo PHP_EOL.'<!-- '.PHP_EOL;
$page['finalMemoryUsage'] = memory_get_usage();
$page['finalLoadTime'] = microtime(true);
$page['queryCount'] = $connection->getQueryCount();
echo 'initialMemoryUsage='.fileSizeToStr($page['initialMemoryUsage'],false).PHP_EOL;
echo 'peakMemoryUsage='.fileSizeToStr($page['peakMemoryUsage'] = memory_get_peak_usage(),false).PHP_EOL;
echo 'finalMemoryUsage='.fileSizeToStr($page['finalMemoryUsage'],false).PHP_EOL;
echo 'loadTime='.number_format($page['finalLoadTime']-$page['startLoadTime'],4).PHP_EOL;
echo 'queryCount[mysql]='.number_format($page['queryCount']).PHP_EOL;
echo ' -->';

 

<!-- 
initialMemoryUsage=346.32 Kb
peakMemoryUsage=1.38 Mb
finalMemoryUsage=1.03 Mb
loadTime=0.1211
queryCount[mysql]=4
-->

 

is there a better way to check, and how about where exactly my peakMemoryUsage is?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.