Evan Martin (evan) wrote in evan_tech,
Evan Martin

gitweb/perl speed

gitweb is nice but slow -- about 400ms to produce the index page for a directory that contains only one project. (Not really worth running mod_perl for, y'know?) By unfair contrast, Google's memory-resident server provides me search results in about 150ms, including HTTP transfer time.

About 200ms of gitweb's runtime seems to be Perl startup time, which I gauged by measuring a simple script that just imports the same things gitweb does and exits immediately. It opens 33 files from directories with "perl" in their name, mostly .pms but a couple .sos as well. Is there a way to "prelink" a perl program?

Perl spends another 140ms around calls to read() on the gitweb script. I guess it's probably parsing at the same time? (The script is 160k(!) of perl code.) I found you can run perlcc -B foo.cgi to produce bytecode, which speeds things up by a bit over 100ms. (Without the -B flag it tries to compile via C and aborts with some internal failure message. The manpage for the package has lots of scary-looking "do not use this for production" messages.) But the module loads are still external, and continue to dominate the startup time.
Tags: fourth wall, git

  • socks5 proxying flash via ssh

    Suppose you're in Germany and want to watch some Flash-based videos that are IP-limited to the US for whatever reason. At first you'd think you could…

  • use chrome as your emacs browser

    The emacs-configured browser is used for operations like previewing your markdown buffer ( markdown-preview; C-c C-c p in markdown-mode). I still…

  • recovering a disk clobbered with dd

    I managed to accidentally dd 600mb over my primary disk; I haven't done that in many years. Adam thankfully pointed out that my data should be…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.