As an implementor, I answer wholeheartedly yes. The naïve implementation of an object system in Perl 5 (stolen almost whole cloth from Python) actively presents many simple and nearly all clever optimizations. Decoupling representation from behavior at the class or metaclass layer would allow gradual and progressive optimizations for memory usage or compatibility with C data structures or persistence mechanisms or JIT with much less work (and much, much less cleverness) than doing so with the simple hash-based lookup mechanism currently in place in Perl 5.
Sorry, but that is tantamount to the single most dishonest thing I've ever seen expressed on PerlMonks!
I usually refrain from trying to predict the future, but: It ain't never gonna happen. Any of it.
You don't need to implement the whole solution to prove me wrong. Just a single demonstration of method call being faster than a hash lookup in Perl 5.
Implement the extension/optimisation in any language you like, but I bet you cannot return a previously set value, to perl via method call, quicker than it can be retrived from a hash.
Note: I'd really like you to prove me wrong. Because such an optimisation could be very beneficial in almost every area of perl.
In reply to Re^4: Some thoughts on Moose Attributes
by BrowserUk
in thread Some thoughts on Moose Attributes
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |