Minimizing X.org 6.8.1 (not KDrive) to meet specs

Francois Tigeot ftigeot at wolfpond.org
Thu Sep 23 09:57:31 PDT 2004


On Thu, Sep 23, 2004 at 10:01:16AM -0400, Sergei Mutovkin wrote:
> Thank you Francois,
> 
> On Thu, 23 Sep 2004 09:20:04 +0200, Francois Tigeot
> <ftigeot at wolfpond.org> wrote:
> > You compile with -O3 and other aggressive options. You should try to use
> > just -march and -Os to save space.
> 
> But as I far as I can see, my binary gets bigger (I don't think by
> much), but RAM usage is more or less the same, even though there is
> more inlining happening. I need maximum X performance I can get out of
> Celeron CPU that I'm dealing with here...

-O3 and such doesn't imply better performance in all cases. You should do
some benchmarking to be sure.
I was surprised to find -Os faster than -O2 during some tests, but then it
was on a VIA C3, which is notorious for not having much cache...

> > I have considerably reduced X.org footprint for use in thin clients.
> > 
> > I get a 6.2 MB /usr/X11R6 and the X server uses 20-23 MB of memory with
> > a 1024x768x24 display. This is with X.org 6.7.0.
> > 
> > The system is based on FreeBSD-5 and I have created a port to build the
> > X Window environment.
> > 
> > You may want to get the sources on http://www.thinbsd.org/ and look into
> > ports/Xorg-thinbsd
> > 
> > Be aware that the build system is dependant on Eric Anholt's X.org ports
> > and as such uses some patches only present in the FreeBSD ports tree.
> 
> so as I understand you are saying that it is impossible to reduce
> considerably size of X without additional patches?

This is not exactly what I meant.

The files in the Xorg-thinbsd port work with the X.org 6.7.0 tree and
other patches used by the officials FreeBSD X.org packages.
They can be as diverse as PCI IDs, include file additions and better
GCC options handling.

I believe most of these are already included in newer X.org versions.


To reduce /usr/X11R6 size I use mainly special options in host.def.
Most fonts can be disabled like this:

	echo "#define BuildSpeedoFonts 		NO"		>> $LOCALDEF
	echo "#define BuildType1Fonts 		NO"		>> $LOCALDEF
	echo "#define BuildCIDFonts 		NO"		>> $LOCALDEF
	echo "#define BuildTrueTypeFonts	NO"		>> $LOCALDEF
	echo "#define Build75DpiFonts		NO"		>> $LOCALDEF

I have patches to apply to Imakefiles where it is not practical to
disable the build and installation of components in an other way, but
they only contribute to a minor part of the size reduction.

For example, xc/programs/xkbcomp/geometry/Imakefile contains a list of
many keyboards description files. I only need 'pc' so I patch all the
others away before build time.

> When I build X it includes quite a number of extensions, say RENDER,
> etc.. QT2.3.0 as used in Kylix 3 does not have any anti-aliasing
> support and as such does not need this extension, however, I can't
> find a way not to compile it in...

There should be an option somewhere in Imakefile hell.
grep(1) is your friend.

> Also, things like Xft... if application of that time (~2001) was not
> compiled with Xft support, does it use that original Font handling of
> X server or Xft is still used in some compatibility mode? If Xft is
> not used, is it safe to remove it completely from X?

ldd can be used to see which libraries your app uses.
 
> Will be be still possible to use TTF fonts (one or two fonts actually)
> without Xft?

I'm not sure for this one. Applications have no problem to display Truetype
fonts, but they run from machines with full-featured X11 installations.

-- 
Francois Tigeot



More information about the xorg mailing list