"Warning: 233 subroutine calls had negative time! The clock being used (-1) is probably unstable, so the results will be as well. #### # spent 7.03s (4.16+2.87) within FastAligner::_get_urls_to_files which was called 4 times, avg 1.76s/call: # 4 times (4.16s+2.87s) by FastAligner::get_alignments at line 184, avg 1.76s/call sub _get_urls_to_files { 50 4 0s my ($self, $slid, $tlid, $source_url, $target_url) = @_; 51 4 0s 4 0s Tracing::trace('FastAligner._get_urls_to_files', "** \$slid=$slid, \$tlid=$tlid"); # spent 0s making 4 calls to Tracing::trace, avg 0s/call 52 4 0s my $urls_to_files = {}; 53 4 0s my $aldir = undef; 54 4 0s my $found_source_url = undef; 55 4 0s my $found_target_url = undef; 56 57 # Alignments directory can be Alignments_ssal_en_fr or Alignments_ssal_fr_en 58 59 4 0s my $aldir_sl_tl = $self->{alignments_directory}."_".$slid."_".$tlid; 60 4 0s my $aldir_tl_sl = $self->{alignments_directory}."_".$tlid."_".$slid; 61 62 # WEBITEXT_CORPORA contains directories named after prealigned corpora (genomics, hc.gc.ca etc). 63 # In each of these directories, there's an Alignment_ssal_sl_tl directory. 64 # In each of these, there's a file called aligned_to_url.txt, that contains mapping from url to 65 # the file containing aligned sentences for that url. urls_to_files will contain that mapping 66 # for source_url and target_url 67 68 4 0s 8 0s opendir(WBT_CORP_DIR, $self->wbt_corpora_dir()); # spent 0s making 4 calls to FastAligner::CORE:open_dir, avg 0s/call # spent 0s making 4 calls to ObjectWithHelpers::AUTOLOAD, avg 0s/call 69 70 4 0s 4 0s foreach my $index_dir (readdir(WBT_CORP_DIR)) # spent 0s making 4 calls to FastAligner::CORE:readdir, avg 0s/call 71 { 72 44 0s if (!($index_dir eq '.') && !($index_dir eq '..')) 73 { 74 36 10.0ms 72 0s my $index_dir_path = File::Spec->canonpath($self->wbt_corpora_dir()."/".$index_dir); # spent 0s making 36 calls to File::Spec::Win32::canonpath, avg 0s/call # spent 0s making 36 calls to ObjectWithHelpers::AUTOLOAD, avg 0s/call 75 36 0s 36 0s opendir(INDEX_DIR, $index_dir_path); # spent 0s making 36 calls to FastAligner::CORE:open_dir, avg 0s/call 76 36 0s 36 0s foreach my $dir (readdir(INDEX_DIR)) # spent 0s making 36 calls to FastAligner::CORE:readdir, avg 0s/call 77 { 78 304 0s if (($dir eq $aldir_sl_tl) || ($dir eq $aldir_tl_sl)) 79 { 80 16 0s 32 0s my $alfile = File::Spec->canonpath($self->wbt_corpora_dir()."/". # spent 0s making 16 calls to File::Spec::Win32::canonpath, avg 0s/call # spent 0s making 16 calls to ObjectWithHelpers::AUTOLOAD, avg 0s/call 81 $index_dir."/".$dir."/aligned_to_url.txt"); 82 83 16 10.0ms 16 10.0ms open F, "<", $alfile; # spent 10.0ms making 16 calls to FastAligner::CORE:open, avg 625µs/call 84 16 0s 16 0s while () { # spent 0s making 16 calls to FastAligner::CORE:readline, avg 0s/call 85 527384 193ms my $line = $_; 86 527384 245ms chomp $line; 87 527384 3.18s 527384 1.86s $line =~ /(.+) >>> (.+)/; # spent 1.86s making 527384 calls to FastAligner::CORE:match, avg 4µs/call 88 527384 610ms if ($source_url eq $2) { 89 $urls_to_files->{$source_url} = $1; 90 $found_source_url = 1; 91 } elsif ($target_url eq $2) { 92 $urls_to_files->{$target_url} = $1; 93 $found_target_url = 1; 94 } 95 527384 2.77s 527384 997ms if (defined($found_source_url) && defined($found_target_url)) # spent 997ms making 527384 calls to FastAligner::CORE:readline, avg 2µs/call 96 { 97 $aldir = File::Spec->canonpath($self->wbt_corpora_dir()."/". 98 $index_dir."/".$dir); 99 close F; 100 closedir(INDEXDIR); 101 closedir(WBT_CORP_DIR); 102 return ($aldir,$urls_to_files); 103 } 104 } 105 16 0s 16 0s close F; # spent 0s making 16 calls to FastAligner::CORE:close, avg 0s/call 106 } 107 } 108 36 10.0ms 36 0s closedir(INDEXDIR); # spent 0s making 36 calls to FastAligner::CORE:closedir, avg 0s/call 109 } 110 } 111 4 0s 4 0s closedir(WBT_CORP_DIR); # spent 0s making 4 calls to FastAligner::CORE:closedir, avg 0s/call 112 4 0s return undef; 113 }