mirror of
https://github.com/NixOS/nix
synced 2025-06-30 07:33:16 +02:00
* Show evaluation stats when NIX_SHOW_STATS=1.
This commit is contained in:
parent
0832956089
commit
310e605995
3 changed files with 30 additions and 15 deletions
|
@ -213,6 +213,27 @@ unsigned int ATermMap::size()
|
|||
}
|
||||
|
||||
|
||||
#include <iostream>
|
||||
|
||||
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
|
||||
|
|
|
@ -111,4 +111,8 @@ private:
|
|||
};
|
||||
|
||||
|
||||
/* Hack. */
|
||||
void printATermMapStats();
|
||||
|
||||
|
||||
#endif /* !__ATERM_MAP_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue