Skip to content

Commit

Permalink
Simple log for cache hit/missed
Browse files Browse the repository at this point in the history
  • Loading branch information
tibvdm committed Aug 26, 2024
1 parent 6fcc66a commit 99f3a0b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions sa-index/src/sa_searcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,17 +309,17 @@ impl Searcher {
// If the kmer is found in the cache, use the bounds from the cache as start bounds
// to find the bounds of the entire string
let mut max_mer_length = min(5, search_string.len());
if let Some(bounds) = self.kmer_cache.get_kmer(&search_string[..max_mer_length]) {
return (self.search_bounds_no_cache(search_string, bounds), true);
}
// if let Some(bounds) = self.kmer_cache.get_kmer(&search_string[..max_mer_length]) {
// return (self.search_bounds_no_cache(search_string, bounds), true);
// }

// TODO: following code might be better on Trembl
// while max_mer_length > 0 {
// if let Some(bounds) = self.kmer_cache.get_kmer(&search_string[..max_mer_length]) {
// return self.search_bounds_no_cache(search_string, bounds, max_mer_length);
// }
// max_mer_length -= 1;
// }
while max_mer_length > 0 {
if let Some(bounds) = self.kmer_cache.get_kmer(&search_string[..max_mer_length]) {
return (self.search_bounds_no_cache(search_string, bounds), true);
}
max_mer_length -= 1;
}

(BoundSearchResult::NoMatches, false)
}
Expand Down

0 comments on commit 99f3a0b

Please sign in to comment.