Question on speed/efficency

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
User avatar
gjb79
Forum Commoner
Posts: 96
Joined: Fri Jul 18, 2003 6:35 am
Location: x <-- (DC)
Contact:

Question on speed/efficency

Post by gjb79 »

I'm not sure if this should go under PHP Theory, but as that says advanced only and I'm sure this is far from advanced, I'll put it here.

:arrow: I have the option of making a series of pages dynamically generated from one file, content from an sql database. Or I could split it to several pages each pulling the content from the sql database.

:?: My question is, if several hundred users visit the site, will there be problems pulling all those pages from one file? Would it be faster or more efficient to have seperate pages, so all the traffic isn't directed to one single file?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

depending on how your code works, there's no difference.. it all depends how your code is.
User avatar
SystemWisdom
Forum Commoner
Posts: 69
Joined: Sat Mar 26, 2005 5:54 pm
Location: A Canadian South of the 49th Parallel

Post by SystemWisdom »

Im not 100% sure, but I believe it would be better to use a single page system, where users are all calling on one page only. The page requests can still be cached on the server side, so multiple requests for the same file will receive the cached file in either situation anyway..

Pages generated from one file also helps speed up development IMHO by basically laying down a framework from which you can add pages without having redundant code carried over in every other page you create..
Eg. if you had 5 pages that shared a common header page, you would have redundant include() code in each of those 5 pages, and if you had to change the code for any reason, you would have to change it in all pages that share that code..

And ya, I think this should be in the Theory section too..
Bennettman
Forum Contributor
Posts: 130
Joined: Sat Jun 15, 2002 3:58 pm

Post by Bennettman »

I'd have to agree. It's potentially less secure, but there's practically no speed difference, and in the end it's easier to just have one page.
User avatar
gjb79
Forum Commoner
Posts: 96
Joined: Fri Jul 18, 2003 6:35 am
Location: x <-- (DC)
Contact:

Post by gjb79 »

Thanks for the advice!

Its kinda what I thought, but I'm some what new at areas of this as I've had no formal training, so I learn in patches and often miss bits of info.

Thanks again!
Post Reply