about summary refs log tree commit diff
path: root/src/fix-ng/primops.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-11-09T10·35+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-11-09T10·35+0000
commit15801c88fad38253b19ac2ea77e7597deab5fd6b (patch)
tree2dab8ab76792328b6c5376509d6b2e659ad19cf8 /src/fix-ng/primops.cc
parentd2e3a132fe6796b2ac038ccb20e7aa32afc1a85f (diff)
* Turned the msg() and debug() functions into macros, since they
  turned out to be a huge performance bottleneck (the text to printed
  would always be evaluated, even when it was above the verbosity
  level).  This reduces fix-ng execution time by over 50%.

  gprof(1) is very useful. :-)

Diffstat (limited to 'src/fix-ng/primops.cc')
-rw-r--r--src/fix-ng/primops.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fix-ng/primops.cc b/src/fix-ng/primops.cc
index fb923ed46e..07281e89be 100644
--- a/src/fix-ng/primops.cc
+++ b/src/fix-ng/primops.cc
@@ -58,7 +58,7 @@ static Path copyAtom(EvalState & state, const Path & srcPath)
     Path drvPath = writeTerm(unparseNixExpr(ne), "");
     state.drvHashes[drvPath] = drvHash;
 
-    msg(lvlChatty, format("copied `%1%' -> closure `%2%'")
+    printMsg(lvlChatty, format("copied `%1%' -> closure `%2%'")
         % srcPath % drvPath);
     return drvPath;
 }
@@ -107,7 +107,7 @@ static string processBinding(EvalState & state, Expr e, NixExpr & ne)
 	string s;
 	bool first = true;
         while (!ATisEmpty(es)) {
-            Nest nest(lvlVomit, format("processing list element"));
+            startNest(nest, lvlVomit, format("processing list element"));
 	    if (!first) s = s + " "; else first = false;
 	    s += processBinding(state, evalExpr(state, ATgetFirst(es)), ne);
             es = ATgetNext(es);
@@ -123,7 +123,7 @@ static string processBinding(EvalState & state, Expr e, NixExpr & ne)
 
 Expr primDerivation(EvalState & state, Expr args)
 {
-    Nest nest(lvlVomit, "evaluating derivation");
+    startNest(nest, lvlVomit, "evaluating derivation");
 
     ATermMap attrs;
     args = evalExpr(state, args);
@@ -143,7 +143,7 @@ Expr primDerivation(EvalState & state, Expr args)
     {
         string key = aterm2String(ATgetFirst(keys));
         Expr value = attrs.get(key);
-        Nest nest(lvlVomit, format("processing attribute `%1%'") % key);
+        startNest(nest, lvlVomit, format("processing attribute `%1%'") % key);
 
         /* The `args' attribute is special: it supplies the
            command-line arguments to the builder. */
@@ -199,7 +199,7 @@ Expr primDerivation(EvalState & state, Expr args)
     Path drvPath = writeTerm(unparseNixExpr(ne), "-d-" + drvName);
     state.drvHashes[drvPath] = drvHash;
 
-    msg(lvlChatty, format("instantiated `%1%' -> `%2%'")
+    printMsg(lvlChatty, format("instantiated `%1%' -> `%2%'")
         % drvName % drvPath);
 
     attrs.set("outPath", ATmake("Path(<str>)", outPath.c_str()));