Tuesday 26 April 2011

Sometimes, things are too fast.

As machines have gotten faster and networks better, one doesnt notice
those annoying things which happen in this non-perfect world.

I have been using X11 CRiSP over a transatlantic link and the
startup time is annoying, along with visible artefacts whilst drawing
the color gradients.

On investigation, the problem is our old-friend: latency. Some
X11 function calls block, waiting for a reply from the server, e.g.
querying color pixel mappings being the core one. The gradient and
pixmap drawing code relies on lots of color allocations, forcing
round trips - large numbers of them.

On a locally connected machine or network, this happens so fast, you
rarely notice it.

CRiSP was written back when monochrome displays were common - certainly
color was a very rare thing. Today, we luxuriate in 24/32 bit video
displays and rarely even think about it.

So, these round trips are pointless when we know what the RGB
mapping will be - no more XQueryColors, or even XAllocColor.

Doing this has a dramatic performance enhancement for these
long latency trips. (You wont notice the speedup on a local
machine - not unless you use special measuring tools).

The first part of this went into CRiSP 10.0.6, and the pixmap
enhancements in 10.0.7.

[Note, I am dropping the trailing letter in CRiSP version numbers -
they never served a real purpose, and people sometimes forget to
feed this back on error reports; the build number tells me everything
I need to track back to specific source code changes].

At the moment, this feature is enabled by setting an environment
variable:


$ export CR_XS_DIRECT=1


http://www.crisp.demon.co.uk/download.html

Post created by CRiSP v10.0.7a-b5977


No comments:

Post a Comment