SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
Thread: Performance question
-
Oct 28, 2007, 01:46 #1
- Join Date
- Jun 2004
- Location
- Montreal
- Posts
- 275
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Performance question
Hi,
I am working on a huge site and need to include several file in some page (classes, function, header, footer, etc...).
So I have 2 questions:
1- Is there a limit number of include files?
2- Is is better to include alot of small file (ex... one class per page) or one big file (with all classes) if sometime I may only need 1 class.
Thank
-
Oct 28, 2007, 03:19 #2
- Join Date
- Oct 2007
- Location
- In the blogosphere
- Posts
- 108
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
1. No practical limit unless you feel like including a gazillion files
2. Smaller files.
I commonly have lots of files that are 'grouped' according to what classes I'd need often. (I have no idea if that makes sense to you)★ bLueFrogX's Blog - Random Ramblings of a NEET Techie ★
-
Oct 28, 2007, 09:47 #3
About many smaller files: If you don't use a php accelerator you'll suffer a big performance hit. And depending on your files structure layout you might have to write quite a few of "require_once".
-
Oct 28, 2007, 09:59 #4
- Join Date
- May 2006
- Location
- Lancaster University, UK
- Posts
- 7,062
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
I just put a single class in a file, and, in one file, require all of the class files.
Then just require that file.Jake Arkinstall
"Sometimes you don't need to reinvent the wheel;
Sometimes its enough to make that wheel more rounded"-Molona
-
Oct 28, 2007, 11:08 #5
I read somewhere about a performance benchmark regarding functions,
Where the author wanted to see if having a bunch of functions that never get called affected performance - and he found out having thousands of functions but not ever calling 'em made very little performance difference.
So going off that I would think that a single large file with alot of classes is more beneficial, but I've never seen any data regarding that.
-
Oct 28, 2007, 11:13 #6
- Join Date
- Jul 2006
- Location
- Ontario, Canada
- Posts
- 424
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
If you're primarily using object oriented programming, consider registering an autoload function to prevent you from having to include files that you don't need.
Bookmarks