Subject: | POE::Filter::Reference reloads freezer module for each new() object |
In POE-0.3009 POE::Filter::Reference is always loading the Storable if you create an object with the default freezer. The problem is the boolean logic around line 77:
unless(ref $freezer and $freeze and $thaw) {
my $package = $freezer;
$package =~ s(::)(\/)g;
delete $INC{$package . ".pm"};
eval {local $^W=0; require "$package.pm"; import $freezer ();};
carp $@ if $@;
($freeze, $thaw)=_get_methods($freezer);
}
$freezer by default is the string 'Storable' and so it is never a reference. This makes that unless() statement always true and so always reloads the freezer package. This happens in the default case and will also happen if you make the freezer a package. I think what it should be is just:
if (!$freeze or !$thaw) { .. }
This gives a considerable performance hit in any code that creates more than one POE::Filter::Reference and a small hit (reloading the Storable module once) for other code just creating one POE::Filter::Reference.
Cheers,
Scott