diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-03-07 01:15:41 +0000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-03-07 01:15:41 +0000 |
| commit | f3fdc2438362d6ec46c6e6989fc03c041dfde47a (patch) | |
| tree | b5a87d0d2fc7f609fb2a36d53ff546091e364da1 /src/hash_map.cc | |
| parent | f0ae0b84102a0cb7d0dda0b8b7b1ba425d5d6eb7 (diff) | |
Remove temporary stats code from HashMap
Diffstat (limited to 'src/hash_map.cc')
| -rw-r--r-- | src/hash_map.cc | 33 |
1 files changed, 0 insertions, 33 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) { |
