Hi Lin,

Lin Yo-An wrote:
Since the original approach doesn't work, here comes another new idea:

When executing method call on an object, if we found the method body are
just 2 op codes (FETCH_OBJ_R and RETURN), we then denote the method is a
"getter method"

And the next time, when we execute the same method, we found the "getter
method" flag, we simply execute FETCH_OBJ_R on that object and return the
value to avoid extra op code execution time.

Do you think if this could work?

For a while I'd also been wondering if we could implement some implementation along these lines. Another approach could be possibly replacing such methods with an C implementation (though I don't know if non-internal classes can have internal methods).

I don't know how successful it will be, but I'm interested to hear how much improvement it gives if you get it working.

Thanks!

--
Andrea Faulds
https://ajf.me/

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

Reply via email to