Stas and I continued our discussion off list, and decided to pop it back
on the list, so here is 1 message, another to follow.

Greg

===
Stanislav Malyshev wrote:
> > Hi!
> >
>> >> ...the message you replied to?
> >
> > I must be missing something here. In my last reply, I raised a number
> > of points, including having unqualified names resolve only to
> > namespace and relation of this to functions and constants. I do not
> > see these points addressed or discussed anywhere in your email. Some
> > less important points - like tradeoffs you need to take for working
> > with internal classes (second reply part in my email) - weren't
> > mentioned either.
Hi Stas,

In your last reply, you asserted that the only solution was to always
resolve unqualified names to namespace::name.  The patch I sent actually
shows that this is unnecessary.
> >
> > Also, I do not see the explanation how this patch is different from
> > the last one and how the difference in the speed is achieved - you
> > just claim it has gone from 466x to 5.2x but I did not find any
> > explanation about what is the change allowed you to do this. I would
> > like to understand what this change is and to do that from reading a
> > patch is kind of hard and I can't be sure what I understood was
> > actually your intent. Could you explain it?
> > You could also contact me on IM or IRC if you prefer.
Basically, the patch does 2 things

1) resolution order is changed to:

foo.php:
$a = new foo();
a) does namespace::foo class exist?
b) try to autoload namespace::foo
c) try to locate internal class ::foo

2) if internal class ::foo is found, then cache this information so that
if another reference to the foo class occurs in foo.php, resolution
short circuits to:
a) use internal class ::foo

This second point is why the slowdown went from ridiculous to slight.

Since your primary complaint about the resolution order is performance,
and the patch removes the performance problem, this makes your
suggestion of never checking internal classes unnecessary.  That was the
point of my previous email with the patch.  Clear now?

Greg

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

Reply via email to