summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-03-07 01:15:41 +0000
committerMaxime Coste <mawww@kakoune.org>2017-03-07 01:15:41 +0000
commitf3fdc2438362d6ec46c6e6989fc03c041dfde47a (patch)
treeb5a87d0d2fc7f609fb2a36d53ff546091e364da1 /src
parentf0ae0b84102a0cb7d0dda0b8b7b1ba425d5d6eb7 (diff)
Remove temporary stats code from HashMap
Diffstat (limited to 'src')
-rw-r--r--src/hash_map.cc33
-rw-r--r--src/hash_map.hh7
2 files changed, 0 insertions, 40 deletions
diff --git a/src/hash_map.cc b/src/hash_map.cc
index 4db90f8c..4220d17e 100644
--- a/src/hash_map.cc
+++ b/src/hash_map.cc
@@ -79,39 +79,6 @@ UnitTest test_hash_map{[] {
}
}};
-struct HashStats
-{
- size_t max_dist;
- float mean_dist;
- float fill_rate;
-};
-
-template<MemoryDomain domain>
-HashStats HashIndex<domain>::compute_stats() const
-{
- size_t count = 0;
- size_t max_dist = 0;
- size_t sum_dist = 0;
- for (size_t slot = 0; slot < m_entries.size(); ++slot)
- {
- auto& entry = m_entries[slot];
- if (entry.index == -1)
- continue;
- ++count;
- auto dist = slot - compute_slot(entry.hash);
- max_dist = std::max(max_dist, dist);
- sum_dist += dist;
- }
-
- return { max_dist, (float)sum_dist / count, (float)count / m_entries.size() };
-}
-
-template<typename Key, typename Value, MemoryDomain domain>
-HashStats HashMap<Key, Value, domain>::compute_stats() const
-{
- return m_index.compute_stats();
-}
-
template<typename Map>
void do_profile(size_t count, StringView type)
{
diff --git a/src/hash_map.hh b/src/hash_map.hh
index df8fd306..47a50cd8 100644
--- a/src/hash_map.hh
+++ b/src/hash_map.hh
@@ -8,10 +8,6 @@
namespace Kakoune
{
-class String;
-
-struct HashStats;
-
template<MemoryDomain domain>
struct HashIndex
{
@@ -120,8 +116,6 @@ struct HashIndex
void clear() { m_entries.clear(); }
- HashStats compute_stats() const;
-
private:
size_t m_count = 0;
float m_max_fill_rate = 0.5f;
@@ -284,7 +278,6 @@ struct HashMap
return not (*this == other);
}
- HashStats compute_stats() const;
private:
Vector<Item, domain> m_items;
HashIndex<domain> m_index;