in reply to Re^3: Some thoughts on Moose Attributes
in thread Some thoughts on Moose Attributes
I guess using internal accessors would (in Perl) facilitate changing the blessed reference type from hashref to arrayref. Or possibly vice versa, though a reason for doing the latter doesn't instantly spring to mind. But the main reason for switching from a hashref to an arrayref is performance. Array lookups using constant subs is a tad quicker than hash lookups.I recall in the earlier days of Perl 5 there was an array-based mechanism added that pre-compiled the slot names into indexes. That was indeed faster, but it was deprecated and removed due to some issues I've forgotten.
There may be more experiments later, with Perl-6 lust and current work in moving parts of Moose to XS. Abstraction opens up all possibilities.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Some thoughts on Moose Attributes
by BrowserUk (Patriarch) on May 02, 2011 at 02:21 UTC |