Re: [Coding Standards] Loading all files at once
| From: | Pádraic Brady | Date: | Mon, 09 Jul 2007 21:33:01 +0000 |
| Subject: | Re: [Coding Standards] Loading all files at once | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-47311@lists.php.net to get a copy of this message | ||
I think part of the problem is where is your __autoload() function? What form do you envisage it
taking? __autoload() definition, Autoload class (much slower by the way) or reliance on an SPL
registered autoload function?
If you're relying on the user to define this it's almost certainly going to add issues -
you cannot expect users to accept PEAR2 running from their application level _autoload() defines.
There is no guarantee they will ever implement the PEAR style classname to file location convention.
Also __autoload() does conflict with the stated purpose of being opcode cache friendly - the last
thing I want to see when running an opcode cache is any significant number of class files being
loaded using it.That should be qualified by noting the impact of __autoload() on an opcode cache is
highly dependent on the nature of the class/functions being cached. A few classes not being 100%
cached (file-only caching) is unlikely to register a blip anywhere on a performance audit.
Solution to the stated goals? I'm not sure there can be one capable of meeting everyone's
needs. The present system would basically gut anyone on shared hosting with that level of file
loading.. I know PHP6 will have a built in opcode cache - and that will be incredibly sexy. Until
then however... I can't see PEAR2 reaching out to shared hosting users in this form. It would
be a no-brainer to spot PEAR2's impact from even a cursory examination of an applications
performance without an opcode cache.
See Travis' benchmarks... Those of us who code to a non-opcode platform have worked to similar
numbers for a long time.
Paddy
Pádraic Brady
http://blog.astrumfutura.com
http://www.patternsforphp.com
----- Original Message ----
From: Joshua Eichorn <josh@bluga.net>
To: Paul M Jones <pmjones@ciaweb.net>
Cc: PEAR developer mailinglist <pear-dev@lists.php.net>
Sent: Monday, July 9, 2007 9:42:40 PM
Subject: Re: [PEAR-DEV] [Coding Standards] Loading all files at once
Having includes strewn throughout all your files allows gives us the
current include_path mess and makes it impossible to use an autoloader
if you want to. How do you propose we solve these problems if we don't
drop the includes out of the files.
-josh
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
____________________________________________________________________________________
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097