From: Ian Jackson Date: Sat, 3 Oct 2009 20:49:07 +0000 (+0100) Subject: WIP routesearch; allow -Ddebugflags=0 X-Git-Tag: 5.0^2~78 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=commitdiff_plain;h=24f73490c5cff2cbe09a575b0929ac181c36704a WIP routesearch; allow -Ddebugflags=0 --- 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(); } }