[Perl] CentOSでDBIC最新版を使うときの注意
WARNING: DBIx::Class::StartupCheck: This version of Perl is likely to exhibit extremely slow performance for certain critical operations. Please consider recompiling Perl. For more information, see https://bugzilla.redhat.com/show_bug.cgi?id=196836 and/or http://lists.scsys.co.uk/pipermail/dbix-class/2007-October/005119.html. You can suppress this message by setting DBIC_NO_WARN_BAD_PERL=1 in your environment.
CentOSでPerlのバージョンとDBIx::Classのバージョンを上げたらDBIx::Classを使うたびにこんなエラーが出るようになりました。
kazeburoさんやYappoさんが言ってたRed Hat系のディストリビューションのPerlのパッケージにはoverloadされたクラスをblessするとリファレンスを全て検索するパッチがあてられていて遅いので注意してねって感じですか。
覗いてみるとDBIx::ClassでuseしてるDBIx::Class::StartupCheckのBEGINブロックで
BEGIN {
{ package TestRHBug; use overload bool => sub { 0 } }
sub _has_bug_34925 {
my %thing;
my $r1 = \%thing;
my $r2 = \%thing;
bless $r1 => 'TestRHBug';
return !!$r2;
}
sub _possibly_has_bad_overload_performance {
return $] < 5.008009 && ! _has_bug_34925();
}
unless ($ENV{DBIC_NO_WARN_BAD_PERL}) {
if (_possibly_has_bad_overload_performance()) {
...snip...
こんな感じでテストしてお節介にご丁寧にメッセージを出してくれてます。0.08008からみたいですね。
メッセージを止めるにはメッセージにあるとおり、環境変数DBIC_NO_WARN_BAD_PERLに値をセットすればオッケー。
とは言え、根本的解決にはならないのでkazeburoさんの言うとおりパッチはずしてrpmbuildしてインストールしました。Feodoraでは8で解決したらしいですがCentOSではまだ解決してないんですね。
Perlのバージョンを上げたらScalar::Utilをforce installしないとWeak references are not implemented in the version of perlになるので要注意です。
