Reply to Re: Include overhead

Your name:

Reply:


Posted by Andy Hassall on 10/12/50 11:26

On 10 Sep 2005 02:11:10 -0700, "Antimon" <antimon@gmail.com> wrote:

>I'm working on a new web application (php5.1 + postgresql) and i wanted
>to have seperated files for each class and use __autoload and i have
>everything split to classes now. This makes my pages need to include a
>lot of files each request. Do this a huge overhead? I mean shall i go
>for gigantic function definition scripts and include all of them at
>once?
>BTW, my classes are not too big, 4-5 methods and properties each, i
>thought having one function definition file might avoid including
>overhead but then php will need to interperate all that functions that
>i will not use.
>What shall i do?

You'd have to test and benchmark both approaches on your system, as it seems
to me there are far too many unknown factors to be able to say one approach has
a clear advantage over the other.

Could this be premature optimisation? I'd be surprised if the absolute
difference between either approach was significant compared with the runtime of
the scripts, particularly since you're communicating with a database.

Might it be best to keep it simple at this stage, i.e. not use autoload but
bear the approach in mind for the future whilst you develop the more important
parts of the code, and then try it out if the size of the included files
appears to be causing a delay?

You might want to look at something like APC which further reduces the cost of
includes by caching the compiled code.

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация