From 24f73490c5cff2cbe09a575b0929ac181c36704a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 3 Oct 2009 21:49:07 +0100 Subject: [PATCH] WIP routesearch; allow -Ddebugflags=0 --- yarrg/TODO | 4 ++++ yarrg/common.h | 2 ++ yarrg/rsmain.c | 7 ++++++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/yarrg/TODO b/yarrg/TODO index ec4daed..80ec177 100644 --- a/yarrg/TODO +++ b/yarrg/TODO @@ -1,5 +1,9 @@ route optimiser - fast version of rsvalue.c ? + time ./routesearch -DN 13460 20210 -1 0.005 search 30 7 + 46.478s without -DN + 9.923 9.920 10.026 9.963 10.072 with -DN + 9.905 9.935 9.948 9.916 9.997 with debugging compiled right out - performance improvements create index sell_by_islandonly on sell (islandid, commodid, price); diff --git a/yarrg/common.h b/yarrg/common.h index 22f61cb..09bb391 100644 --- a/yarrg/common.h +++ b/yarrg/common.h @@ -83,7 +83,9 @@ enum { #endif /*DEBUG_FLAG_LIST*/ +#ifndef debug_flags extern unsigned debug_flags; +#endif void debug_flush(void); #ifndef debug diff --git a/yarrg/rsmain.c b/yarrg/rsmain.c index 7904c01..868d790 100644 --- a/yarrg/rsmain.c +++ b/yarrg/rsmain.c @@ -10,15 +10,20 @@ int max_dist= -1; int main(int argc, const char **argv) { const char *arg; +#ifndef debug_flags debug_flags= ~( dbg_sql2 ); +#endif sysassert( !setvbuf(debug,0,_IOLBF,0) ); for (;;) { arg= *++argv; if (arg[0] != '-') break; +#ifndef debug_flags if (!strcmp(arg,"-DN")) { debug_flags= 0; - } else { + } else +#endif + { abort(); } } -- 2.30.2