SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    To users of profilers - what is your php execution time?

    Hello!

    This is a question to anyone who uses Xdebug or other profiling tool.

    I was always curious what is the acceptable php execution time of a fairly complex MVC-based page creation.

    In my own work I have seen time from 100 milliseconds to under 10 milliseconds

    My own goal is to try to have a page generated under 30 milliseconds, which I consider good, anything over that time, I consider 'can be improved'

    Recently after rewriting my CMS and making lots of changes and switching to using XSL as templating engine I started seeing some pages rendered under 10 milliseconds, which made me very happy.


    What is your target of maximum php execution time?

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    It takes 1000 ms to get to one second. 100 ms is a good time and not something I would lose sleep over. Because the HTTP and TCP and every other network protocol is going to be slow.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Addict skunkbad's Avatar
    Join Date
    Apr 2008
    Location
    Temecula, CA
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There's no way that the average person viewing your website will know the difference between 30ms or 300ms. Why drive yourself nuts?

    I think it would be more important to minimize images and other media. Download heavy content is what is going to make the difference in download speed as seen by your site visitors. You could have a view generate in 1ms, but if the content is a flash movie that is 3MB there is going to be slowness.

  4. #4
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For a busy site its very important. Less execution time means you can serve more pages per second, the difference can be 10 times as many pages can be served if a page executes in 30ms vs 300ms.

    minimizing images and scripts is also important, but its a different type of optimization, a different topic.

    Quote Originally Posted by skunkbad View Post
    There's no way that the average person viewing your website will know the difference between 30ms or 300ms. Why drive yourself nuts?

    I think it would be more important to minimize images and other media. Download heavy content is what is going to make the difference in download speed as seen by your site visitors. You could have a view generate in 1ms, but if the content is a flash movie that is 3MB there is going to be slowness.

  5. #5
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also the profiler reports only the php execution time, which usually does not include the time spend for fetching database queries. That's also a different type of optimization, can be improved by using some type of cache to cache common sql results (like memcache)

  6. #6
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Sharedlog.com View Post
    For a busy site its very important. Less execution time means you can serve more pages per second, the difference can be 10 times as many pages can be served if a page executes in 30ms vs 300ms.
    Have you tested that theory? 30ms can serve 10 times as many request as 300ms.
    Also are you including PHP compiling and interpretation with your figure?
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  7. #7
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know if xdebug report includes compilation time and interpretation time.
    I can ask that on xdebug list.

    As far as theory on being able to server more pages if script executes faster? I think its a simple math, if a script takes less cpu time, then cpu wil be available to process more instructions.

    Quote Originally Posted by logic_earth View Post
    Have you tested that theory? 30ms can serve 10 times as many request as 300ms.
    Also are you including PHP compiling and interpretation with your figure?

  8. #8
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,026
    Mentioned
    64 Post(s)
    Tagged
    0 Thread(s)
    0 ms

    Seriously, 1000 ms is acceptable to me but my new framework is a lazy thing that tries to make apache do all the work through clever caching. If the page is static except for the client's ability to edit it then most likely the framework won't even start, apache will just read out the cache.

    Part of the way I'm doing this is by using code snippets embedded into the cache rather than the full framework codebase. For instance one of them is the cache expiry that starts the framework and re-evals the page once per interval - say per day or hour or the like. For pages that never expire then PHP may not even be used *at all*

  9. #9
    SitePoint Evangelist
    Join Date
    Aug 2005
    Location
    Winnipeg
    Posts
    498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    50% faster than every open source applicaiton/project I have installed on my local machine...then I know relatively speaking I'm doing good.

    Really going on fixed time is like comparing apples to oranges...

    On my dev server (950 AMD -- 6 years old) scripts run quickly but nothing like they doon my new i7 Quad Core with 6GB ram :P
    The only constant in software is change itself


Bookmarks

Posting Permissions

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