Re: Object getter method optimization
| From: | Andrea Faulds | Date: | Sat, 19 Mar 2016 20:40:09 +0000 |
| Subject: | Re: Object getter method optimization | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-91781@lists.php.net to get a copy of this message | ||
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/