Execution Time - What is a Good Number?
Posted: Wed Jan 17, 2007 4:15 pm
Hey Guys-
Well, I've done some searching and haven't found an answer to this. I am in the process of writing a PHP based CMS system (its actually a conversion of an older system I wrote in CF).
Anywho, so far I have been aiming for page execution times in the range of 0.050 Seconds or less. Obviously, for some complex functions, this will climb, but for primary pages that just have a design template wrapped around some customer entered HTML, this is my goal. In general, I am able to get most pages to load in less than 0.020, but I'm trying to figure out if I am being too restrictive on myself?
In addition, how well does PHP handle concurrency and is there a good way to test this? Mainly what I'm curious about is, if I have 10 visitors requesting the same page all at once (say the home page), does PHP create a seperate request for each one, or does it handle them one at a time? I know that Apache spawns a separate request for each, but just not sure about PHP itself.
Also, when handling include files, I tend to use require_once() so that the page fails if it can't find a file, but so that it doesn't include the file all the time. What kind of a time hit is incurred by including includes all up front? Specifically, I have about 5 libraries of functions that I include by default as about 70% of the pages require at least one function from each. The main ones are a Database Abstraction Layer for performing all DB queries and a Mail Abstraction layer. Now, obviously not every page requires the DB or even email, but what are the downsides to including multiple require_onces? Basically is it better to have one require_once at the beginning of an application, or is it better to have the call require_once called only when needed, but possibly getting called 10 - 12 times in a single page execution?
Thanks for any help you can give, and if you can point me to some threads or sites with this information, that's fine as well. My searches didn't turn up much, but I may not be searching the best way possible for this forum.
Well, I've done some searching and haven't found an answer to this. I am in the process of writing a PHP based CMS system (its actually a conversion of an older system I wrote in CF).
Anywho, so far I have been aiming for page execution times in the range of 0.050 Seconds or less. Obviously, for some complex functions, this will climb, but for primary pages that just have a design template wrapped around some customer entered HTML, this is my goal. In general, I am able to get most pages to load in less than 0.020, but I'm trying to figure out if I am being too restrictive on myself?
In addition, how well does PHP handle concurrency and is there a good way to test this? Mainly what I'm curious about is, if I have 10 visitors requesting the same page all at once (say the home page), does PHP create a seperate request for each one, or does it handle them one at a time? I know that Apache spawns a separate request for each, but just not sure about PHP itself.
Also, when handling include files, I tend to use require_once() so that the page fails if it can't find a file, but so that it doesn't include the file all the time. What kind of a time hit is incurred by including includes all up front? Specifically, I have about 5 libraries of functions that I include by default as about 70% of the pages require at least one function from each. The main ones are a Database Abstraction Layer for performing all DB queries and a Mail Abstraction layer. Now, obviously not every page requires the DB or even email, but what are the downsides to including multiple require_onces? Basically is it better to have one require_once at the beginning of an application, or is it better to have the call require_once called only when needed, but possibly getting called 10 - 12 times in a single page execution?
Thanks for any help you can give, and if you can point me to some threads or sites with this information, that's fine as well. My searches didn't turn up much, but I may not be searching the best way possible for this forum.