Lexical-Accessor

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

            Don't do anything, but are allowed; effectively inline comments.

  Class Methods
    `lexical_has`
        This function may also be called as a class method.

  Comparison (benchmarking, etc)
    Lexical::Accessor is almost three times faster than
    MooX::PrivateAttributes, and almost twenty time faster than
    MooseX::Privacy. I'd also argue that it's a more "correct" implementation
    of private accessors as (short of performing impressive PadWalker
    manipulations), the accessors generated by this module are completely
    invisible to subclasses, method dispatch, etc.

    Compared to the usual Moose convention of using a leading underscore to
    indicate a private method (which is a very loose convention; it is quite
    common for subclasses to override such methods!), Lexical::Accessor
    clearly offers much better method privacy. There should be little
    performance hit from using lexical accessors compared to normal Moose
    accessors. (However they are nowhere near the speed of the XS-powered
    accessors that Moo *sometimes* uses and Mouse *usually* uses.)

lib/Lexical/Accessor.pm  view on Meta::CPAN

This function may also be called as a class method.

=back

=head2 Comparison (benchmarking, etc)

Lexical::Accessor is almost three times faster than
L<MooX::PrivateAttributes>, and almost twenty time faster than
L<MooseX::Privacy>. I'd also argue that it's a more "correct"
implementation of private accessors as (short of performing impressive
L<PadWalker> manipulations), the accessors generated by this module
are completely invisible to subclasses, method dispatch, etc.

Compared to the usual Moose convention of using a leading underscore
to indicate a private method (which is a very loose convention; it is
quite common for subclasses to override such methods!),
L<Lexical::Accessor> clearly offers much better method privacy. There
should be little performance hit from using lexical accessors compared
to normal L<Moose> accessors. (However they are nowhere near the speed
of the XS-powered accessors that L<Moo> I<sometimes> uses and L<Mouse>
I<usually> uses.)



( run in 0.685 second using v1.01-cache-2.11-cpan-05444aca049 )