Page 1 of 1

php execution speed

Posted: Thu Aug 02, 2007 12:42 pm
by cpetzol2
Hello,

Currently I am developing a website, and find myself being torn between coding as efficiently as possible and using extra code to provide good structure.

When you run 100-200 lines of code, the client gets a response from the server very quickly for every new page request. At what point will it start to take more time for every page request (lets say 2 seconds or more) on a website that has so few users that on average only 1 user is on the site at any given time?

What about if there are 10 people on the website at any given time?

I am sorry if these are malformed questions. If the above is just a bunch of blabber, any information regarding speed vs size of php would be great.

thanks

Posted: Thu Aug 02, 2007 12:53 pm
by MrPotatoes
this is more of a theory and design question.

i decide it upon how big code base is. if ti's a large code base (over 1K lines of code) then i recode for structure. if it's under that then i just code it to work. but that is personal though. i don't take PHP as serious as i used to and i code this for a living lmao

Posted: Thu Aug 02, 2007 12:54 pm
by miro_igov
The number of lines in code does not slow down the script. The speed depends on what operations you do. Queries returning large record sets executed to remote SQL server may slow it down, parsing external RSS sources also.

Memory consuming processes make the script slow, etc.

Posted: Thu Aug 02, 2007 1:04 pm
by MrPotatoes
miro_igov wrote:The number of lines in code does not slow down the script
i'm not sure if you were replying to me or not.

well, you're right. personally though, the more lines of code there are the more structure i put into it so it will be easier to manage down the line. if it's a guestbook or a calander then i just get it out there. that is a personal preferance for someone that codes PHP in his spare time for misc things.