On Mon, 2005-08-29 at 11:49 +0100, Ross Burton wrote: > On Sat, 2005-08-27 at 20:43 -0400, Owen Taylor wrote: > > cpp is built into GCC these days, so is not lightweight by any means. > > > > I don't know if there is a 10k cpp implementation out there, but if > > there is, then switching X.org to use that might by the right course in > > this area. > > People have said this but I don't see it: > > $ which cpp > /usr/bin/cpp > $ ll /usr/bin/cpp > lrwxrwxrwx 1 root root 7 2005-08-21 15:01 /usr/bin/cpp -> cpp-4.0 > $ ll /usr/bin/cpp-4.0 > -rwxr-xr-x 1 root root 90232 2005-08-21 19:51 /usr/bin/cpp-4.0 > $ ldd /usr/bin/cpp-4.0 > linux-gate.so.1 => (0xffffe000) > libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7dee000) > /lib/ld-linux.so.2 (0xb7f2d000) > > Using "strace -e open" doesn't show cpp opening at runtime any other > libraries. > > What is xrdb/cpp *doing* in the 10% of the startup time? It doesn't > perform any I/O as gnome-settings-daemon does that instead, and streams > the contents of the files into xrdb's stdin. cpp and gcc are just wrapper scripts. $ strace -f -e execve cpp foo.c > /dev/null execve("/usr/bin/cpp", ["cpp", "foo.c"], [/* 38 vars */]) = 0 Process 16288 attached Process 16287 suspended [pid 16288] execve("/usr/libexec/gcc/i386-redhat-linux/4.0.1/cc1", ["/usr/libexec/gcc/i386-redhat-lin"..., "-E", "-quiet", "foo.c"], [/* 40 vars */]) = 0 Process 16287 resumed Process 16288 detached --- SIGCHLD (Child exited) @ 0 (0) --- Process 16287 detached $ ls -l /usr/libexec/gcc/i386-redhat-linux/4.0.1/cc1 -rwxr-xr-x 1 root root 4576236 Aug 26 22:34 /usr/libexec/gcc/i386-redhat-linux/4.0.1/cc1 Taking a 1-2 seconds to read a binary of that size isn't great, and likely object-file reordering could improve things quite a bit, but it should be more believable than for a 90k executable. Regards, Owen
Attachment:
signature.asc
Description: This is a digitally signed message part