Bugzilla – Bug 4325
[PATCH] xrdb should use mcpp if it's available
Last modified: 2011-10-15 16:31:06 UTC
Every time xrdb is called it spawns cpp, which is a 4MB binary.
This is overkill for simply parsing X resource files and slows down X startup
time. If I replace calls to 'xrdb -merge' with 'xrdb -cpp mcpp -merge' I get a
~1 second startup time improvement (from when I type my password to when the
disk stops spinning, under gnome).
xrdb should check if mcpp is available at compile time, and if so use that.
Got a patch?
No, I would need to understand how imake works first. :(
But I'll come up with such a patch if it's likely to be accepted...
The other problem is: how common is mcpp installed, anyway? It certainly isn't
installed by default on my ubuntu system.
Also, on my system cpp looks to be the same size as mcpp: 90K bytes.
So where is this problem, again?
It's not installed by default, but there are Debian and Ubuntu packages for it.
I don't know about fedora.
Regarding size, ccp is 90k but on my system it vforks and execs
/usr/lib/gcc/i486-linux-gnu/4.0.2/cc1, which on my system is 4.3M
You can see this with "strace -f cpp"
Created attachment 3142 [details] [review]
Try preferred preprocessors before falling back to CPP
Tries the preprocessors in the preferred_cpps variable one by one and runs the
first one it finds. If there are no preprocessors or if none can be found, it
falls back to the CPP defined at compile time.
The list of preferred preprocessors defaults to "mccp"
I disagree with this approach. X should use standard utilities as much as possible.
If you want to micro-optimize things this way, you already have all the knobs
It is also possible to specify CppCmd=/usr/bin/mcpp in host.def (or add support
for the autoconf build) for this kind of use.
Originally I had considered detecting the cpp binary at compile time, but then
if it were uninstalled xrdb would break completely, which is even worse.
With the runtime check, it just works if mcpp (or any other compiler you want to
put into the list) is present, and falls back gracefully if not.
Added patch keyword
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=339683 blocks this: it makes
mcpp useless for xrdb without that patch, which seems to be seriously bitrotting.
Sorry about the phenomenal bug spam, guys. Adding xorg-team@ to the QA contact so bugs don't get lost in future.
I originally wrote a patch for startup scripts instead of build-time.
Patch doesn't apply. Bug is totally inactive. Closing.
If you want to revive this, please send a patch to email@example.com.