Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the App-Benchmark-Accessors CPAN distribution.

Report information
The Basics
Id: 49509
Status: resolved
Worked: 10 min
Priority: 0/
Queue: App-Benchmark-Accessors

People
Owner: Nobody in particular
Requestors: EWILHELM [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.06
Fixed in: (no value)



Subject: add Class::Accessor::Classy
The attached patch adds Class::Accessor::Classy to the benchmarks. Thanks, Eric
Subject: cac.patch
diff --git a/Makefile.PL b/Makefile.PL index d5a3c08..778c874 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -11,6 +11,7 @@ requires 'UNIVERSAL::require'; requires 'Class::Accessor'; requires 'Class::Accessor::Complex'; requires 'Class::Accessor::Constructor'; +requires 'Class::Accessor::Classy'; requires 'Class::Accessor::Fast'; requires 'Class::Accessor::Fast::XS'; requires 'Class::MethodMaker'; diff --git a/lib/App/Benchmark/Accessors.pm b/lib/App/Benchmark/Accessors.pm index 33e8316..a7c5b87 100644 --- a/lib/App/Benchmark/Accessors.pm +++ b/lib/App/Benchmark/Accessors.pm @@ -60,6 +60,12 @@ package # hide from PAUSE use base 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 WithMojo; diff --git a/t/construction.t b/t/construction.t index ba80ba1..a91981f 100644 --- a/t/construction.t +++ b/t/construction.t @@ -18,6 +18,7 @@ benchmark_diag($iterations, { class_accessor_fast_xs => sub { WithClassAccessorFastXS->new } , class_accessor_complex => sub { WithClassAccessorComplex->new } , class_accessor_constructor => sub { WithClassAccessorConstructor->new } , + class_accessor_classy => sub { WithClassAccessorClassy->new } , mojo => sub { WithMojo->new } , class_methodmaker => sub { WithClassMethodMaker->new } , object_tiny => sub { WithObjectTiny->new } , diff --git a/t/get.t b/t/get.t index d78ffb4..ceaf015 100644 --- a/t/get.t +++ b/t/get.t @@ -17,6 +17,7 @@ my $ClassAccessorFast = WithClassAccessorFast->new; my $ClassAccessorFastXS = WithClassAccessorFastXS->new; my $ClassAccessorComplex = WithClassAccessorComplex->new; my $ClassAccessorConstructor = WithClassAccessorConstructor->new; +my $ClassAccessorClassy = WithClassAccessorClassy->new; my $Mojo = WithMojo->new; my $ClassMethodMaker = WithClassMethodMaker->new; my $Accessors = WithAccessors->new; @@ -40,6 +41,7 @@ benchmark_diag($iterations, { class_accessor_fast_xs => sub { $ClassAccessorFastXS->myattr }, class_accessor_complex => sub { $ClassAccessorComplex->myattr }, class_accessor_constructor => sub { $ClassAccessorConstructor->myattr }, + class_accessor_classy => sub { $ClassAccessorClassy->myattr }, mojo => sub { $Mojo->myattr }, class_methodmaker => sub { $ClassMethodMaker->myattr }, object_tiny => sub { $ObjectTiny->myattr }, diff --git a/t/set.t b/t/set.t index c1d2391..41df344 100644 --- a/t/set.t +++ b/t/set.t @@ -17,6 +17,7 @@ my $ClassAccessorFast = WithClassAccessorFast->new; my $ClassAccessorFastXS = WithClassAccessorFastXS->new; my $ClassAccessorComplex = WithClassAccessorComplex->new; my $ClassAccessorConstructor = WithClassAccessorConstructor->new; +my $ClassAccessorClassy = WithClassAccessorClassy->new; my $Mojo = WithMojo->new; my $ClassMethodMaker = WithClassMethodMaker->new; my $Accessors = WithAccessors->new; @@ -39,6 +40,7 @@ benchmark_diag($iterations, { class_accessor_fast_xs => sub { $ClassAccessorFastXS->myattr(27) }, class_accessor_complex => sub { $ClassAccessorComplex->myattr(27) }, class_accessor_constructor => sub { $ClassAccessorConstructor->myattr(27) }, + class_accessor_classy => sub { $ClassAccessorClassy->set_myattr(27) }, mojo => sub { $Mojo->myattr(27) }, class_methodmaker => sub { $ClassMethodMaker->myattr(27) }, accessors => sub { $Accessors->myattr(27) },
On Tue Sep 08 02:43:53 2009, EWILHELM wrote: Show quoted text
> The attached patch adds Class::Accessor::Classy to the benchmarks.
Applied, committed and released (v0.07). Thank you for the patch!