| 95 | } |
| 96 | |
| 97 | void AlgorithmRunner::printCacheStats() const |
| 98 | { |
| 99 | if (!m_options.showCacheStats) |
| 100 | return; |
| 101 | |
| 102 | CacheStats totalStats{}; |
| 103 | size_t disabledCacheCount = 0; |
| 104 | for (size_t i = 0; i < m_programCaches.size(); ++i) |
| 105 | if (m_programCaches[i] != nullptr) |
| 106 | totalStats += m_programCaches[i]->gatherStats(); |
| 107 | else |
| 108 | ++disabledCacheCount; |
| 109 | |
| 110 | m_outputStream << "---------- CACHE STATS ----------" << std::endl; |
| 111 | |
| 112 | if (disabledCacheCount < m_programCaches.size()) |
| 113 | { |
| 114 | for (auto& [round, count]: totalStats.roundEntryCounts) |
| 115 | m_outputStream << "Round " << round << ": " << count << " entries" << std::endl; |
| 116 | m_outputStream << "Total hits: " << totalStats.hits << std::endl; |
| 117 | m_outputStream << "Total misses: " << totalStats.misses << std::endl; |
| 118 | m_outputStream << "Size of cached code: " << totalStats.totalCodeSize << std::endl; |
| 119 | } |
| 120 | |
| 121 | if (disabledCacheCount == m_programCaches.size()) |
| 122 | m_outputStream << "Program cache disabled" << std::endl; |
| 123 | else if (disabledCacheCount > 0) |
| 124 | { |
| 125 | m_outputStream << "Program cache disabled for " << disabledCacheCount << " out of "; |
| 126 | m_outputStream << m_programCaches.size() << " programs" << std::endl; |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | void AlgorithmRunner::populationAutosave() const |
| 131 | { |
nothing calls this directly
no test coverage detected