0

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?

1
  • 1
    Most likely, more time is spent contacting the server and waiting for a response than anything else. Commented Mar 18, 2011 at 8:14

4 Answers 4

2

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

Sign up to request clarification or add additional context in comments.

Comments

2

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

Comments

2

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

Comments

1

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.

1 Comment

I appreciate ur replay and your right about that xdebug is difficult to install. I've tried once for 4h and I didn't make it run. I don;t know how to use Firebug, when it is about PHP code. FirePHP is an option but it doen't run on my machine setup after 30minutes of tries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.