From 310e605995dc104bee29d330ac135e3e2bb82f97 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 8 May 2006 10:00:37 +0000 Subject: * Show evaluation stats when NIX_SHOW_STATS=1. --- src/libutil/aterm-map.cc | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'src/libutil/aterm-map.cc') diff --git a/src/libutil/aterm-map.cc b/src/libutil/aterm-map.cc index e0cfefa2d5f4..60092382a2f3 100644 --- a/src/libutil/aterm-map.cc +++ b/src/libutil/aterm-map.cc @@ -213,6 +213,27 @@ unsigned int ATermMap::size() } +#include + +void printATermMapStats() +{ + cout << "RESIZES: " << nrResizes << " " + << sizeTotalAlloc << " " + << sizeCurAlloc << " " + << sizeMaxAlloc << endl; + + cout << "SET: " + << nrItemsSet << " " + << nrSetProbes << " " + << (double) nrSetProbes / nrItemsSet << endl; + + cout << "GET: " + << nrItemsGet << " " + << nrGetProbes << " " + << (double) nrGetProbes / nrItemsGet << endl; +} + + #if 0 int main(int argc, char * * argv) { @@ -294,19 +315,6 @@ int main(int argc, char * * argv) } - cout << "RESIZES: " << nrResizes << " " - << sizeTotalAlloc << " " - << sizeCurAlloc << " " - << sizeMaxAlloc << endl; - - cout << "SET: " - << nrItemsSet << " " - << nrSetProbes << " " - << (double) nrSetProbes / nrItemsSet << endl; - - cout << "GET: " - << nrItemsGet << " " - << nrGetProbes << " " - << (double) nrGetProbes / nrItemsGet << endl; + printATermMapStats(); } #endif -- cgit 1.4.1