Re: Removing xrdb for 10% startup win?



On Sun, 28 Aug 2005, Ikke wrote:

> On Sun, 2005-08-28 at 07:57 -0400, Behdad Esfahbod wrote:
> >
> > Or simply use make with cpp-produced dependency rules!  15
> > minutes of hacking.
> >
> Stopwatch just started, waiting for the patch ;)

Attached.  Ok, 30 mintues ;).

--behdad
http://behdad.org/
--- /etc/X11/xinit/xinitrc-common.orig	2005-08-28 08:06:35.000000000 -0400
+++ /etc/X11/xinit/xinitrc-common	2005-08-28 08:33:37.000000000 -0400
@@ -24,8 +24,20 @@
 sysxkbmap=/etc/X11/Xkbmap
 
 # merge in defaults
-[ -r "$sysresources" ] && xrdb -merge "$sysresources"
-[ -r "$userresources" ] && xrdb -merge "$userresources"
+[ -r "$sysresources" ] && xrdb -nocpp -merge "$sysresources"
+if [ -r "$userresources" ]; then
+    {
+	echo "-include $userresources.dep"
+	echo '%.compiled: %'
+	echo '	cpp -MP -MD -MF "$<.dep" -MT "$@" -o "$@" -E -nostdinc "$<"'
+    } | make -f /dev/stdin "$userresources.compiled" &>/dev/null
+
+    if [ $? = 0 ]; then
+	xrdb -nocpp -merge "$userresources.compiled"
+    else
+	xrdb -merge "$userresources"
+    fi
+fi
 
 # merge in keymaps
 if [ -r "$sysxkbmap" ]; then


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]