> perl 5.10.0 compiled with configure.gnu (FreeBSD6.2, 3Ghz P4 prescott, > DDR333). > [EMAIL PROTECTED] /home/syber =>./perl510/bin/perl test/cst.plx > Benchmark: running seta, setao, setb, setbo for at least 1 CPU seconds... > seta: 1 wallclock secs ( 1.03 usr + 0.00 sys = 1.03 CPU) @ > 177939.39/s (n=183500) > setao: 1 wallclock secs ( 1.05 usr + 0.00 sys = 1.05 CPU) @ > 221411.34/s (n=231790) > setb: 1 wallclock secs ( 1.06 usr + 0.00 sys = 1.06 CPU) @ > 174841.41/s (n=185769) > setbo: 1 wallclock secs ( 0.99 usr + 0.01 sys = 1.00 CPU) @ > 220200.00/s (n=220200)
> perl 5.8.8 compiled with configure.gnu (the same machine)
> [EMAIL PROTECTED] /home/syber =>./operl58/bin/perl test/cst.plx
> Benchmark: running seta, setao, setb, setbo for at least 1 CPU seconds...
> seta: 1 wallclock secs ( 1.09 usr + 0.00 sys = 1.09 CPU) @
> 268435.20/s (n=293601)
> setao: 1 wallclock secs ( 1.10 usr + 0.00 sys = 1.10 CPU) @
> 307535.89/s (n=338770)
> setb: 1 wallclock secs ( 1.08 usr + 0.00 sys = 1.08 CPU) @
> 272325.57/s (n=293601)
> setbo: 1 wallclock secs ( 1.12 usr + 0.00 sys = 1.12 CPU) @
> 303234.69/s (n=338770)
Now, the curious thing to me is that set_inherited is also slower, on
all 4 variations of blessed instance and non-blessed class.
set_inherited isn't nearly as complicated as get_inherited is:
> sub set_inherited {
> my ($self, $set, $val) = @_;
>
> if (blessed $self) {
> if (reftype $self eq 'HASH') {
> return $self->{$set} = $val;
> } else {
> croak('Cannot set inherited value on an object instance that is
> not hash-based');
> };
> } else {
> no strict 'refs';
>
> return ${$self.'::__cag_'.$set} = $val;
> };
> }
So, to me, that almost points to blessed itself, which just sounds too
obvious. Could you benchmark just blessed() on each version?
What version of Scalar::Util do you have? Is it all possible it's a
non-compiled version?
What if you replace blessed $self with ref $self just for giggles?
/me scratches head...
-=Chris
signature.asc
Description: OpenPGP digital signature
_______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]
