Ive write a PHP app which copy some pictures from a public website, but it runs pretty slow. I'll like to see where I have a bottleneck, or where the most times is spent. How can i do that?
I'm using Eclipse PDT as IDE. Are any plugins for it?
Ive write a PHP app which copy some pictures from a public website, but it runs pretty slow. I'll like to see where I have a bottleneck, or where the most times is spent. How can i do that?
I'm using Eclipse PDT as IDE. Are any plugins for it?
You should try xdebug: http://www.xdebug.org/docs/profiler
And here is a documentation about PDT and xdebug: http://www.eclipse.org/pdt/documents/XDebugGuideForPDT2.0.pdf
Usually code to read/copy data from other servers will cause bottle neck. You can use below code to measure time for some parts of your code then figure it out
<?php
$time_start = microtime(true);
// your slow code here...
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "$time elapsed\n";
?>
Use Webgrind for detecting bottlenecks https://github.com/jokkedk/webgrind Its an web interface for XDebug profiling.
On the server side, Xdebug is complex to install, configure, use (in eclipse), but it is powerful once you understand it.
On the client side, in Firefox, try Firebug; or in Chrome, try the Chrome developer tools to determine which elements of the web page need most time to load. Might be simple I/O problem if you're using high-resolution embedded images on your site, or network contacting times as a commenter suggested.