about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/eval.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 38f198fb86ca..ee17c996c6f9 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -527,9 +527,12 @@ extern "C" {
 
 void printEvalStats(EvalState & state)
 {
-    printMsg(lvlInfo,
+    bool showStats = getEnv("NIX_SHOW_STATS", "0") != "0";
+    printMsg(showStats ? lvlInfo : lvlDebug,
         format("evaluated %1% expressions, %2% cache hits, %3%%% efficiency, used %4% ATerm bytes")
         % state.nrEvaluated % state.nrCached
         % ((float) state.nrCached / (float) state.nrEvaluated * 100)
         % AT_calcAllocatedSize());
+    if (showStats)
+        printATermMapStats();
 }