# spent 28.7s (0ns+28.7) within Searcher::searchWord which was called 2 times, avg 14.4s/call: # 2 times (0ns+28.7s) by Searcher::search at line 62, avg 14.4s/call sub searchWord($) { my $self = shift; my $searchedString = shift; my @word = (); my @engwords = (); my $engword; my @skwordsSet = (); my $skwordSet; my @engwordsSet = (); my $engwordSet; my @skwords = (); my $skword; if($self->{direction} eq "eng") { my @engwords = $schema->resultset('Engword')->search({engword =>searchedString}); # spent 12.8s making 1 call to DBIx::Class::ResultSet::search # spent 1.00ms making 1 call to DBIx::Class::Schema::resultset foreach $engword(@engwords){ my @skwordsSet = $engword->skwords; foreach $skwordSet(@skwordsSet){ push(@word,$skwordSet->skword); } # foreach } # foreach } # if if($self->{direction} eq "svk") { my @skwords = $schema->resultset('Skword')->search({skword => $searchedString}); # spent 9.87s making 1 call to DBIx::Class::ResultSet::search # spent 1.00ms making 1 call to DBIx::Class::Schema::resultset foreach $skword(@skwords){ my @engwordsSet = $skword->engwords; # spent 6.07s making 1 call to MyDictionary::Schema::Skword::engwords foreach $engwordSet(@engwordsSet){ push(@word,$engwordSet->engword); # spent 0s making 4 calls to MyDictionary::Schema::Engword::engword, avg 0s/call } # foreach } # foreach } # if return @word; } # method searchWord