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: 40660
Status: resolved
Priority: 0/
Queue: App-Benchmark-Accessors

People
Owner: Nobody in particular
Requestors: siracusa [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Add Rose::Object
Please add Rose::Object to the list of accessor generators. I've attached a patch that should do it.
Subject: add-rose.diff
diff -r -u App-Benchmark-Accessors-0.02/lib/App/Benchmark/Accessors.pm App-Benchmark-Accessors-0.021/lib/App/Benchmark/Accessors.pm --- App-Benchmark-Accessors-0.02/lib/App/Benchmark/Accessors.pm 2008-11-04 11:40:56.000000000 -0500 +++ App-Benchmark-Accessors-0.021/lib/App/Benchmark/Accessors.pm 2008-11-04 11:49:29.000000000 -0500 @@ -118,6 +118,12 @@ use Class::XSAccessor accessors => { myattr => 'myattr' }, replace => 1; +package # hide from PAUSE + WithRose; +use base qw(Rose::Object); +use Rose::Object::MakeMethods::Generic(scalar => 'myattr'); + + 1; diff -r -u App-Benchmark-Accessors-0.02/t/get.t App-Benchmark-Accessors-0.021/t/get.t --- App-Benchmark-Accessors-0.02/t/get.t 2008-11-04 11:40:19.000000000 -0500 +++ App-Benchmark-Accessors-0.021/t/get.t 2008-11-04 11:49:29.000000000 -0500 @@ -25,6 +25,7 @@ my $ClassXSAccessor = WithClassXSAccessor->new; my $ClassXSAccessorArray = WithClassXSAccessorArray->new; my $ObjectTinyXS = WithObjectTinyXS->new; +my $Rose = WithRose->new; benchmark_diag($iterations, { moose => @@ -61,5 +62,7 @@ sub { $ClassXSAccessorArray->myattr }, object_tiny_xs => sub { $ObjectTinyXS->myattr }, + rose => + sub { $Rose->myattr }, }); diff -r -u App-Benchmark-Accessors-0.02/t/set.t App-Benchmark-Accessors-0.021/t/set.t --- App-Benchmark-Accessors-0.02/t/set.t 2008-11-04 11:40:20.000000000 -0500 +++ App-Benchmark-Accessors-0.021/t/set.t 2008-11-04 11:49:29.000000000 -0500 @@ -24,6 +24,7 @@ my $ClassXSAccessor = WithClassXSAccessor->new; my $ClassXSAccessorArray = WithClassXSAccessorArray->new; my $ObjectTinyXS = WithObjectTinyXS->new; +my $Rose = WithRose->new; benchmark_diag($iterations, { moose => @@ -58,5 +59,7 @@ sub { $ClassXSAccessorArray->myattr }, object_tiny_xs => sub { $ObjectTinyXS->myattr }, + object_tiny_xs => + sub { $Rose->myattr(27) }, });
Thanks for the patch! I've uploaded a new version, 0.03, with the patch included.