Branch: Tag:

2000-11-27

2000-11-27 14:09:15 by Per Hedbor <ph@opera.com>

Dumping system reworked somewhat. No files are compiled during normal Roxen startup any more. Shaved .5 seconds of boot time on lain (now down to 0.9 seconds)

Rev: server/base_server/configuration.pike:1.399
Rev: server/base_server/fonts.pike:1.65
Rev: server/base_server/roxen.pike:1.582
Rev: server/etc/roxen_master.pike:1.108
Rev: server/languages/catala.pike:1.10
Rev: server/languages/croatian.pike:1.10
Rev: server/languages/czech.pike:1.16
Rev: server/languages/dutch.pike:1.9
Rev: server/languages/english.pike:1.13
Rev: server/languages/finnish.pike:1.8
Rev: server/languages/french.pike:1.11
Rev: server/languages/german.pike:1.10
Rev: server/languages/hungarian.pike:1.6
Rev: server/languages/italian.pike:1.12
Rev: server/languages/japanese.pike:1.17
Rev: server/languages/maori.pike:1.8
Rev: server/languages/norwegian.pike:1.9
Rev: server/languages/polish.pike:1.7
Rev: server/languages/portuguese.pike:1.10
Rev: server/languages/russian.pike:1.8
Rev: server/languages/serbian.pike:1.9
Rev: server/languages/slovenian.pike:1.15
Rev: server/languages/spanish.pike:1.9
Rev: server/languages/swedish.pike:1.16

4:   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.      // ABS and suicide systems contributed freely by Francesco Chemolli - constant cvs_version="$Id: roxen.pike,v 1.581 2000/11/27 09:46:03 per Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.582 2000/11/27 14:09:11 per Exp $";      // Used when running threaded to find out which thread is the backend thread,   // for debug purposes only.
52:   # define THREAD_WERR(X)   #endif    + #define DDUMP(X) sol( combine_path( __FILE__, "../../" + X ), dump ) + static function sol = master()->set_on_load; +  +    string query_configuration_dir()   {    return configuration_dir;
672:    }       mapping mu; -  +  string rrhf;    static void got_connection()    {    object q = accept( );    if( q )    { -  +  if( !requesthandler ) +  { +  requesthandler = (program)(rrhf); +  }    object c;    if( refs < 2 )    {
808:    ip = i;       restore(); -  catch { +  if( file_stat( "../local/"+requesthandlerfile ) ) +  rrhf = "../local/"+requesthandlerfile; +  else +  rrhf = requesthandlerfile; +  DDUMP( rrhf ); + #ifdef DEBUG    if( !requesthandler ) -  requesthandler = (program)("../local/"+requesthandlerfile); -  }; -  if( !requesthandler ) -  requesthandler = (program)(requesthandlerfile); +  requesthandler = (program)(rrhf); + #endif    ::create();    if(!bind( port, got_connection, ip ))    {
1043: Inside #if undefined(DEBUG)
   static void realize()    {    if( catch { +  DDUMP( prog );    real = (program)prog;    protocols[name] = real;    } )
1342:    return 0;    }    sort_urls(); -  report_notice(LOC_S(3, "Registered %s for %s")+"\n", +  report_notice(" "+LOC_S(3, "Registered %s for %s")+"\n",    url, conf->query_name() );       return 1;
2351:       // This is currently needed to resolve the circular references in    // RXML.pmod correctly. :P +  foreach(({ "module.pmod","PEnt.pike", "PExpr.pike","PXml.pike", +  "refs.pmod","utils.pmod" }), string q ) +  DDUMP( "etc/modules/RXML.pmod/"+ q );    master()->resolv ("RXML.refs");    master()->resolv ("RXML.PXml");    master()->resolv ("RXML.PEnt"); -  -  // Dump some programs (for speed) +  dump( "etc/modules/RXML.pmod/module.pmod" ); +  // Already loaded. No delayed dump possible.    dump( "etc/roxen_master.pike" );    dump( "etc/modules/Dims.pmod" ); -  // dump( "etc/modules/RXML.pmod/module.pmod" ); -  foreach(({ "module.pmod","PEnt.pike", "PExpr.pike","PXml.pike", -  "refs.pmod","utils.pmod" }), string q ) -  dump( "etc/modules/RXML.pmod/"+ q ); +     dump( "etc/modules/Roxen.pmod" ); -  +     dump( "base_server/config_userdb.pike" );    dump( "base_server/disk_cache.pike" );    dump( "base_server/roxen.pike" );
2898:    }   }    -  - void dump( string file ) + void dump( string file, program|void p )   {    if( file[0] != '/' )    file = getcwd() +"/"+ file;   #ifdef __NT__    file = normalize_path( file );   #endif -  program p = master()->programs[ replace(file, "//", "/" ) ]; +  if(!p) +  p = master()->programs[ replace(file, "//", "/" ) ];   #ifdef __NT__    if( !p )    {
2919:   #endif       array q; -  + #ifdef MUCHU_DUMP_DEBUG + # define DUMP_DEBUG + #endif    if(!p)    {   #ifdef DUMP_DEBUG
2937: Inside #if defined(DUMP_DEBUG)
  #ifdef DUMP_DEBUG    report_debug("** Cannot encode "+file+": "+describe_backtrace(q)+"\n");   #else - // array parts = replace(file, "//", "/") / "/"; - // if (sizeof(parts) > 3) parts = parts[sizeof(parts)-3..]; - // report_debug("Dumping failed for " + parts*"/" + "\n"); +  array parts = replace(file, "//", "/") / "/"; +  if (sizeof(parts) > 3) parts = parts[sizeof(parts)-3..]; +  report_debug("Notice: Dumping failed for " + parts*"/"+" (not a bug)\n");   #endif    }   #ifdef DUMP_DEBUG
2947:    werror( file+" dumped successfully to "+ofile+"\n" );   #endif    } - #ifdef DUMP_DEBUG + #ifdef MUCHO_DUMP_DEBUG    else    werror(file+" already dumped (and up to date)\n");   #endif
2985:    array argv = tmp;    tmp = 0;    +  DDUMP( "base_server/slowpipe.pike" ); +  DDUMP( "base_server/fastpipe.pike" );    slowpipe = ((program)"slowpipe");    fastpipe = ((program)"fastpipe"); -  +  dump( "base_server/throttler.pike" );       add_constant( "Protocol", Protocol );   #if constant(SSL.sslfile)    add_constant( "SSLProtocol", SSLProtocol );   #endif    -  call_out( lambda() { -  (program)"module"; -  dump( "protocols/http.pike"); -  dump( "protocols/ftp.pike"); -  dump( "base_server/state.pike" ); -  dump( "base_server/highlight_pike.pike"); -  dump( "base_server/wizard.pike" ); -  dump( "base_server/proxyauth.pike" ); -  dump( "base_server/html.pike" ); -  dump( "base_server/module.pike" ); -  dump( "base_server/throttler.pike" ); -  dump( "base_server/smartpipe.pike" ); -  dump( "base_server/slowpipe.pike" ); -  dump( "base_server/fastpipe.pike" ); -  dump( "languages/abstract.pike" ); -  }, 9); +  dump( "etc/modules/Variable.pmod/module.pmod" ); +  dump( "etc/modules/Variable.pmod/Language.pike" );    -  +  DDUMP( "base_server/state.pike" ); +  DDUMP( "base_server/highlight_pike.pike" ); +  DDUMP( "base_server/wizard.pike" ); +  DDUMP( "base_server/proxyauth.pike" ); +  DDUMP( "base_server/module.pike" ); +  DDUMP( "base_server/throttler.pike" ); +  DDUMP( "base_server/smartpipe.pike" ); +  DDUMP( "base_server/fastpipe.pike" ); +     mark_fd(0, "Stdin");    mark_fd(1, "Stdout");    mark_fd(2, "Stderr");
3032:       add_constant( "roxen.fonts",    (fonts = ((program)"base_server/fonts.pike")()) ); -  dump( "base_server/fonts.pike" ); +     -  +  +  DDUMP( "languages/abstract.pike" );    initiate_languages(query("locale")); -  +     set_locale();      #if efun(syslog)