Re: allfiles.php has nothing to do with performance -please read the proposal CAREFULLY

From: Date: Tue, 28 Aug 2007 14:36:46 +0000
Subject: Re: allfiles.php has nothing to do with performance -please read the proposal CAREFULLY
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-47881@lists.php.net to get a copy of this message
Alexey Borzov wrote: > Hi, > > Gregory Beaver wrote: >> Several people have mistakenly cited allfiles.php as a performance-based >> decision. It is not. > > Maybe that's because *you* claim that it is a performance based decision? > > > http://wiki.pear.php.net/index.php/PEAR2_Standards#Loading_all_files_at_once«,‹¯r6,Í > Ð/éPÄK± > > "PEAR2/PackageName/allfiles.php is the "load all classes at once for > easy startup and *opcode caches friendliness*" > >> The purpose of allfiles.php is to provide a >> vector to do two things: >> >> 1) beginners who just want to see how a package works and do not yet >> have PEAR installed can simply use this procedure to try a package out Let's not put a (bad) solution in the hands of beginners, they will take it as this is the best way to do it, when this is absolutely not the case, at least not directly out of the "package box". Beginners specially will not go the extra mile to understand package dependency and include file order, etc... This will result in "PEAR is bloated" feeling and turn off such beginners -- one could also make the argument that a beginner would not know what bloated code is, but it's no way to educated people by giving them bad tools to start with. > A better solution would be to provide a "one file - one package" > distribution or a phar file. Doesn't sound like a good idea to me. It wouldn't allow developers to override one class of the package for bug fixes for instance. >> 2) advanced users who wish to see which files are within a package can >> use it to decide which files they wish to include directly > > They can also do this by a simple > var_dump(get_included_files()); > at the end of the script, why mandate a useless extra file? Agreed, not needed for the advanced users. An out-of-the-box allfiles.php, might be useful to run tests though. >> It serves no useful performance purpose, and is likely to be slower than >> both require_once and __autoload() for complex packages because more >> files are loaded. Indeed. -Philippe

« previous php.pear.dev (#47881) next »