Kaynağa Gözat

apt-cache: stats: Average is over used, not all, buckets

It does not make sense to consider empty buckets in the
average, as they do not affect the lookup performance.
Julian Andres Klode 10 yıl önce
ebeveyn
işleme
6d7fc45ed4
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      cmdline/apt-cache.cc

+ 1 - 1
cmdline/apt-cache.cc

@@ -172,7 +172,7 @@ static void ShowHashTableStats(std::string Type,
    cout << "Total buckets in " << Type << ": " << NumBuckets << std::endl;
    cout << "  Unused: " << UnusedBuckets << std::endl;
    cout << "  Used: " << UsedBuckets  << std::endl;
-   cout << "  Average entries: " << Entries/(double)NumBuckets << std::endl;
+   cout << "  Average entries: " << Entries/(double)UsedBuckets << std::endl;
    cout << "  Longest: " << LongestBucket << std::endl;
    cout << "  Shortest: " << ShortestBucket << std::endl;
 }