2008/10/27 Stanislav Malyshev <[EMAIL PROTECTED]>:

> Actually, one time is enough, as it can bring an application from
> essentially zero disk accesses (with bytecode caching) to multiple disk
> accesses (to traverse full include path to exhaust all autoloading
> capabilities).

So we're talking about an __autoload() that uses relative paths right?

> That's how 100% of existing code is written, btw, and how 100% of existing
> programmers are educated.

I'm not sure I understand your argument. First of all, as you pointed
out there is virtually no code out there using namespace so we can
only speculate about how programmers will be educated on namespaces.
Then, if we assume that most people will use the global namespace
without prefixing it, what would be the best resolution order for
them? (you didn't mention it in your previous message)

> How they are supposed to know that?

People who care about performance are supposed to profile their
code... I guess? If they don't, they probably don't really care about
it. People who care about performance are supposed to be knowledgeable
about good practices.

> It doesn't give any error, it doesn't
> give any indication anything is wrong. It's just slow. Expecting all people
> to scrupulously study every note in the manual is over-optimistic at best.

Include + relative path does not give any indication either and it
does exactly what you've described above (traverse the full include
path). Neither does in_array() or the thousand other slow things we
can do with PHP. As I said I only expect people who care about
performance to study that kind of things. Wouldn't it be more
beneficial to the users to educate them on the performance
implications of using relative paths in __autoload() rather than base
the scope resolution on worst-case scenari?

> What's "average application"? There are no namespaced applications now.

I'm thinking about taking any of Wordpress, phpBB, Drupal, etc... and
making them run in a namespace. Well, it would only work for those
that use __autoload(). With relative paths. Come to think of it, why
would an application autoload files that aren't in its directory?
That's what perplexes me the most about your position, I can't  think
of real-life examples where the performance impact would be as bad as
you describe it.

-JD

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to