App-Benchmark-Accessors

 view release on metacpan or  search on metacpan

lib/App/Benchmark/Accessors.pm  view on Meta::CPAN

use parent qw(Class::XSAccessor::Compat);
__PACKAGE__->mk_accessors(qw/myattr/);

package    # hide from PAUSE
  WithClassAccessorComplex;
use parent qw(Class::Accessor::Complex);
__PACKAGE__->mk_new->mk_scalar_accessors(qw/myattr/);

package    # hide from PAUSE
  WithClassAccessorConstructor;
use parent qw(Class::Accessor::Constructor Class::Accessor::Complex);
__PACKAGE__->mk_constructor->mk_scalar_accessors(qw/myattr/);

package    # hide from PAUSE
  WithClassAccessorClassy;
use Class::Accessor::Classy;
with 'new';
rw 'myattr';
no  Class::Accessor::Classy;

package    # hide from PAUSE
  WithClassAccessorLite;
use Class::Accessor::Lite new => 1, rw => [qw(myattr)];

package    # hide from PAUSE
  WithMojo;
use parent qw(Mojo::Base);
__PACKAGE__->attr('myattr');

package    # hide from PAUSE
  WithClassMethodMaker;
use Class::MethodMaker
    [ scalar => [ qw/myattr/ ],
      new    => [ qw/-hash new/ ],
    ];

package    # hide from PAUSE
  WithObjectTiny;
use Object::Tiny qw/myattr/;

package    # hide from PAUSE
  WithSpiffy;
use Spiffy -base;
field 'myattr';

package    # hide from PAUSE
  WithClassSpiffy;
use Class::Spiffy -base;
field 'myattr';

package    # hide from PAUSE
  WithAccessors;
use accessors qw(myattr);
sub new { bless {}, shift }

package    # hide from PAUSE
  WithClassXSAccessor;
use Class::XSAccessor accessors => { myattr => 'myattr' };
sub new {
    my $class = shift;
    bless { @_ } => $class;
}

package    # hide from PAUSE
  WithClassXSAccessorArray;
use Class::XSAccessor::Array accessors => { myattr => 0 };
sub new {
    my $class = shift;
    my %args = @_;
    bless [ $args{myattr} ] => $class;
}

package    # hide from PAUSE
  WithObjectTinyXS;
use Object::Tiny qw/myattr/;
use Class::XSAccessor accessors => { myattr => 'myattr' }, replace => 1;

package    # hide from PAUSE
  WithRose;
use parent qw(Rose::Object);
use Rose::Object::MakeMethods::Generic(scalar => 'myattr');

#package    # hide from PAUSE
#  WithBadgerClass;
#use Badger::Class
#    base     => 'Badger::Base',
#    mutators => 'myattr';

package    # hide from PAUSE
  WithRubyishAttribute;
use Rubyish::Attribute;
sub new { bless {}, shift }

attr_accessor "myattr";
#>>>
1;

__END__

=head1 NAME

App::Benchmark::Accessors - Benchmark accessor generators

=head1 DESCRIPTION

This distribution runs benchmarks on various accessor generators. The
following generators are being benchmarked:

=over 4

=item Moose

mutable and immutable

=item Mouse

mutable and immutable

=item Class::Accessor

=item Class::Accessor::Fast

=item Class::Accessor::Fast::XS

=item Class::XSAccessor::Compat

=item Class::Accessor::Complex

=item Class::Accessor::Constructor

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.007 second using v1.00-cache-1.14-grep-28634ff-cpan-4d46879620f )