Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder crmpicco's Avatar
    Join Date
    Jan 2005
    Location
    Mauchline, Scotland
    Posts
    1,096
    Thanks
    15
    Thanked 1 Time in 1 Post

    Question What kind of information is acquired when profiling a php script

    Hi all,

    Can anyone advise on this question that has came up in a practice Zend exam:

    What kind of information is acquired when profiling a php script (choose 2):

    A. a list of all of the op-codes executed by the engine
    B. the files and functions and/or parameters which where executed during the php script
    C. the execution times of files and functions during the php script
    D. a list of all the variables used in a php script
    E. a list of errors which have occurred

    Best Regards,
    Picco

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    This is an ambiguous question.
    Different profilers are often used for different purposes.
    Hmm tricky tricky. I'd go with C and D. Since you don't need a profiler to list the errors that occured (though the php profilers will), its primary features I'd say would be the execution times and counts for the functions (and memory usage) and the list of the variables (and likely their memory usage). Since the purpose of profiling is to optimize, these should be the two most benifitial ones to use.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #3
    Senior Coder crmpicco's Avatar
    Join Date
    Jan 2005
    Location
    Mauchline, Scotland
    Posts
    1,096
    Thanks
    15
    Thanked 1 Time in 1 Post
    Thanks Fou-Lu. It was something I never really had much luck in looking into in terms of research.

    That make more sense, I guess if I think of it as more optimisiation rather than debugging or fault finding that might help. Cheers.

    Do you have any PHP profiling sources?

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    pecl has a few, I've used the APD which is a debugger but can do some profiling. Seems to be ok: http://php.ca/manual/en/book.apd.php
    Zend has an optimizer as well, but I've never used it. I'm pretty sure eclipse uses xdebug for its debugger which sorta has a profile feel, but doesn't report times or counts. There are a number of builtin functions as well that are helpful like debug_backtrace and debug_zval_dump.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #5
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,286
    Thanks
    12
    Thanked 344 Times in 340 Posts
    Quote Originally Posted by Fou-Lu View Post
    I'm pretty sure eclipse uses xdebug for its debugger which sorta has a profile feel, but doesn't report times or counts.
    XDebug itself collects that information (available through a CacheGrinder).
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Quote Originally Posted by Dormilich View Post
    XDebug itself collects that information (available through a CacheGrinder).
    Ah sweet, I didn't know that! +1 to eclipse
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •