http://qs1969.pair.com?node_id=30948


in reply to RE: Training wheels again
in thread Training wheels again

Ooops, sorry, of course I used Apache::DBI, Version 0.87 :).

Replies are listed 'Best First'.
RE: big performance gain
by arturo (Vicar) on Sep 08, 2000 at 20:02 UTC

    What makes me curious is the difference you see when you stop using CGI.pm. I realize this won't translate to the full-blown handler version of the script, but did you try loading CGI.pm via default in mod_perl, or did you have

    use CGI;
    in your script?

    "He's got about as much personality as a loaf of bread" -- Wally Pleasant, She's in love with a Geek

      No, I didn't preload CGI.pm, I just said "use CGI qw(:standard);".

      I did this because I wanted to measure the performance of a CGI script that's handed over to Apache::Registry.

        There's a huge performance difference between use CGI and use CGI qw(:standard) because the latter has to make 150 or so symbols through an import, where the former simply loads the "lincoln loader" selfloader and compiles subroutines as needed.

        -- Randal L. Schwartz, Perl hacker

      Yeah, I would be interested in this too. Is CGI.pm being used from within a test script, or from startup.pl/httpd.conf? You could also try only importing things like use CGI qw/:standard/. I believe CGI.pm has some magic code inside to help with memory when you do so, although I haven't perused the source in quite some time now. Either way, if CGI.pm is being preloaded I wouldn't think you would see as much of a hit, since it stays resident in memory and isn't loaded each time the script is called.

      Cheers,
      KM