I've never used Class::DBI, but a quick look shows that the code for Class::DBI::Column is very simple. It might be worth hacking it to cache the lower-case version of the classname to see if that makes a difference:
use overload '""' => sub { shift->{'name_lc'} }, fallback => 1; [...] sub new { my ($class, $name) = @_; return $class->SUPER::new( { name => $name, name_lc => lc($name), _groups => {}, placeholder => '?' } ); } sub name_lc { shift->{'name_lc'} }
That should save quite a chunk from the first two lines of your profile output:
%Time Sec. #calls sec/call F name 14.67 55.4872 2174052 0.000026 <anon>:...5.8.2/Class/DBI/Colu +mn.pm:37 9.55 36.1474 2178574 0.000017 Class::DBI::Column::name_lc
Be careful though if any other classes are inheriting from CDBI::Column - you'd need to check that this hack is compatible with their expectations. (I'd expect it to be ok though, as long as inheritors call their SUPER::new() to construct.)
Hugo
In reply to Re: Using Devel::Profile output to know what to do next
by hv
in thread Using Devel::Profile output to know what to do next
by water
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |