joel@WSL.DEC.COM (06/23/88)
I improved the XtGetGC substantially recently, these changes will go into the R3 release. The two biggest changes I made were to make the GC list self-organized: when you match against an existing GC, move it to the head of the list. On the DEC mail program this reduced average search length from about 6.8 Matches per search down to 1.7 Matches per search. Secondly, I vastly increased the speed of Match by checking against the most commonly specified fields first, then short-circuiting at two places if nothing else needed to be checked. For the programs I was profiling, this got the two routines down into the noise. There may still be a need to break up the linear list by hashing on, say, foreground, background, and font, maybe one or two others. I'm always leery of linear lists. But this is one place where locality of reference really minimized search length on the programs I profiled. - Joel McCormack