1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 04:21:16 +02:00

* 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. :-)
This commit is contained in:
Eelco Dolstra 2003-11-09 10:35:45 +00:00
parent d2e3a132fe
commit 15801c88fa
10 changed files with 60 additions and 45 deletions

View file

@ -64,17 +64,17 @@ int main(int argc, char * * argv)
try {
initAndRun(argc, argv);
} catch (UsageError & e) {
msg(lvlError,
printMsg(lvlError,
format(
"error: %1%\n"
"Try `%2% --help' for more information.")
% e.what() % programId);
return 1;
} catch (Error & e) {
msg(lvlError, format("error: %1%") % e.msg());
printMsg(lvlError, format("error: %1%") % e.msg());
return 1;
} catch (exception & e) {
msg(lvlError, format("error: %1%") % e.what());
printMsg(lvlError, format("error: %1%") % e.what());
return 1;
}