> > >> I was playing with this idea sometime ago, it gives good performance > boost for code like `for ($i = 0; $i < 100000; $i++) $a->getFoo();` but in > the end of the day it's a very limited optimization. > If you abstract away from getters and say you want to optimize more and > more small functions like this one, you end up realizing that what you're > actually doing is what JIT compilation would do in a more generic way.
I agree with you that JIT could achieve this. Although this could be done by JIT, however the JIT approach would require good code generation to produce efficient getter code to return the property value, and there will be a JIT threshold and extra compilation time for caller to reach. > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Sent from Gmail Mobile