Return-Path: xpert-request@athena.mit.edu
Received: by expo.lcs.mit.edu; Wed, 12 Oct 88 22:43:58 EDT
Received: by ATHENA.MIT.EDU (5.45/4.7) id AA19136; Wed, 12 Oct 88 22:44:21 EDT
Received: by BLOOM-BEACON.MIT.EDU with sendmail-5.59/4.7 
	id <AA01583@BLOOM-BEACON.MIT.EDU>; Wed, 12 Oct 88 22:38:46 EDT
Received: from USENET by bloom-beacon.mit.edu with netnews
	for xpert@athena.mit.edu (xpert@athena.mit.edu)
	(contact usenet@bloom-beacon.mit.edu if you have questions)
Date: 13 Oct 88 00:07:28 GMT
From: hp-sdd!megatek!corona!rgs@hplabs.hp.com  (Rusty Sanders)
Subject: Re: Speeding up the X server on sun3's
Message-Id: <388@megatek.UUCP>
References: <163@topologixtopologix.com>
Sender: xpert-request@athena.mit.edu
To: xpert@athena.mit.edu

>From article <163@topologixtopologix.com>, by devin@topologixtopologix.com (Devin Hooker):
> I have seen discussion about speeding up the x server on sun 3's, and I was
> wondering how to do this?  AtDhVaAnNkCsE.
> 
I presume you're talking about color X on a sun (since mono isn't toooo bad).
First off, you wait for X11R3 to be release, since one of the things you're
likely to want to speed up is already sped up some. With that in hand, you
start a lot of coding.

First thing to do is get hold of the purdue mods for mono X and do similar
things in color X. That means changing cfbmskbits.h and cfbmskbits.c. While
you're in there do something about the PFILL macro (use a lookup table instead
of logic, it's only 256 words).

That will get you about 6%-10%, in general. *Whoopie*, that's the end of the
easy things to do.

The first real specific place is glyph rendering. Look at cfbteglyphblt.c . 
Currently it paints glyphs left to right, top to bottom. Change it so it
goes the other way. allowing you to calculate the masks only once.
Now, break out the getstipplepixel calls into real code, move anything
invarient you can out of the loop, declare registers to point at the
data, and otherwise optimize the bejeezus out of the thing.

After that trivial excersize create cfbimggblt.c and cfbplygblt.c, based on
a combo of cfbtegblt.c and the corresponding mfbimggblt.c and mfbplygblt.c.

After that you'll have moderatly fast glyphs (probably about 1/2 to 1/3
as fast as what I do, but I'll leave it as an extra credit effort to figure
out how that works, sorry).

Next thing is probably line drawing (if you use the window manager any, you'll
notice it's maddening). That one's easy. Just steal mfbline.c, mfbhrzvert.c,
and mfbbres.c and modify them to peices. Remember, don't ever use a macro
without known EXACTLY what code it generates. If you want good performance,
don't do the same calculation twice.

You may want to speed up tiled drawing and solid area drawing. Those are in
Those are in cfbfillsp.c. By now, you should be getting a good feel for what
to do, so I won't go into it.

That should give you enough for a goodly period of time. I wish that I could
contribute the stuff I've done to get good speed out of the server, but my
company (rightly so) believes it's proprietary. Guess you'll just have to
buy our sun based system :-) (Actually, I do use some hardware on our FBM
which gives me very good scroll speed, fast and painless cursoring, and
a minor speedup on clipping to odd pixel boundaries).

I suspect the reason that nobody's gone and contributed a faster version
of X for the sun is that it's non trivial to get there (actually, for any
cfb based system). Any company which invests the effort will probably want
to keep that advantage. At the moment, then, your only option is to roll up
your sleeves and dig in to it.

(By the way, your system name "topologix" is 9 characters long. That upsets
many uucp sites. By the time the message got to me you return address was
devin@topologixtopologix.com , evidently having one of its "."s striped.
I would suggest you change the name of your site, 8 characters is the most
allowed, I believe)
Rusty Sanders, Megatek Corp. --> rgs@megatek or...
         ...ucsd!
..hplabs!hp-sdd!megatek!rgs
  ...ames!scubed!
