php execution speed

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cpetzol2
Forum Newbie
Posts: 11
Joined: Tue Feb 27, 2007 7:31 pm

php execution speed

Post 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
User avatar
MrPotatoes
Forum Regular
Posts: 617
Joined: Wed May 24, 2006 6:42 am

Post 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
miro_igov
Forum Contributor
Posts: 485
Joined: Fri Mar 31, 2006 5:06 am
Location: Bulgaria

Post 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.
User avatar
MrPotatoes
Forum Regular
Posts: 617
Joined: Wed May 24, 2006 6:42 am

Post 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.
Post Reply