cgi-bin
Erik Poupaert
erik.poupaert@skynet.be
Sun Sep 14 21:13:00 GMT 2003
> This is on linux/x86? Last time I looked at this, I found libgcj.so
> startup time was dominated by relocation processing.
> You should get faster startups with a static build
Yes. linux/X86; CHOST="i686-pc-linux-gnu".
Linking with "-static" and "stripping" (or "-s") indeed has a beneficial performance
effect. Startup is even visually quite a bit faster. Hopefully fast enough for
cgi-bin applications. It looks promising.
Before:
$ ls -l test.cgi
-rwxr-xr-x 1 erik users 14331 Sep 14 18:10 test.cgi
After (linking statically + stripping):
erik@linuxpresario binlin32 $ ls -l test.cgi
-rwxr-xr-x 1 erik users 2221532 Sep 14 18:32 test.cgi
It adds 2 Mb to the payload, though...
Just to give you an idea. I'm toying around with nullsoft's webmail.cgi application.
It is a fairly complete web-based email solution à la hotmail, while test.cgi just
prints 3 lines to the console with System.out.println:
$ ls -l
total 2256
-rwxr-xr-x 1 erik users 2221532 Sep 14 18:33 test.cgi
-rwxr-xr-x 1 erik users 84064 Sep 14 17:01 webmail.cgi
Frustrating, isn't it?
Actually, webmail.cgi also revolves primarily around printf-ing to stdout
(apparently cgi doesn't require much more).
> or else experiment
> with prelinking support that has been trickling into recent linux
> distributions (RH9, maybe?)
> (RH9, maybe?)
If they have it, they've been really quiet about it.
I've tried in the interim with the Gentoo "prelink" instruction:
# ldd test.cgi
libgcc_s.so.1 => /usr/local/gcc/3.3/lib/libgcc_s.so.1 (0x40001000)
libgcj.so.4 => /usr/local/gcc/3.3/lib/libgcj.so.4 (0x40009000)
libm.so.6 => /lib/libm.so.6 (0x412cc000)
libpthread.so.0 => /lib/libpthread.so.0 (0x412f0000)
libdl.so.2 => /lib/libdl.so.2 (0x41145000)
libc.so.6 => /lib/libc.so.6 (0x41016000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x41000000)
And I got all these errors about X11 (?).
# prelink test.cgi
prelink: /usr/X11R6/bin/uil: Could not parse `/usr/X11R6/bin/uil: error while loading
shared libraries: libMrm.so.3: cannot open shared object file: No such file or
directory' prelink: /usr/X11R6/bin/xmanimate: Could not parse
`/usr/X11R6/bin/xmanimate: error while loading shared libraries: libMrm.so.3: cannot
...
"Prelink" seems quite broken, or else not quite finished yet. Duh.
More information about the Java
mailing list