dole
dole

Reputation: 433

evaluate my php code

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?

Upvotes: 0

Views: 137

Answers (4)

knb
knb

Reputation: 9333

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.

Upvotes: 1

osm
osm

Reputation: 4218

Use Webgrind for detecting bottlenecks https://github.com/jokkedk/webgrind Its an web interface for XDebug profiling.

Upvotes: 2

ngduc
ngduc

Reputation: 1413

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";
?>

Upvotes: 2

Peter Porfy
Peter Porfy

Reputation: 9040

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

Upvotes: 2

Related Questions