Moving xkbcomp into the server

Paulo César Pereira de Andrade pcpa at
Mon Nov 17 22:06:28 PST 2008

> On Mon, Nov 17, 2008 at 11:25:25AM -0800, Dan Nicholson wrote:
>> I decided to take a crack at moving xkbcomp into the server so it's
>> not popen'd whenever a keymap is loaded. For the first crack, I'm
>> trying to just leave xkbcomp pretty much unchanged except for the
>> interface. What's causing me the most difficulty is converting to
>> server API. One snag I've hit is XStringToKeysym. Here's an example
>> usage in the xkbcomp parser:
> As much as I'd like to see it in the server - is the popen the painful
> bit?

  We are currently using the patch I posted sometime ago, to cache
xkbcomp output on some oems. It should make significant difference
on "low profile" computers. But I did not extend it to not not do
things like parse the geometry, to avoid breaking the specs. But
I think it is not quite reliably anymore... At least libxkbui
was not working with xorgcfg for some time, and xorgcfg was probably
the only client using it.

  But really, some major cleanup should be done. The geometry code
I believe is more then half of the computing time, and not used.
Also, the caching should be done on a more higher layer, instead
of sha1'ing all the xkbmap, it should sha1 just the
"main descriptions", like the "setxkbmap -print" output.

> AFAIU, the current approach goes from RMLVO to Kkcstg to xkb to xkm, every
> time we call InitKeyboardDeviceStruct.
> Ideally, we'd like to cache and re-use as much as possible. Usually, all
> keyboards come up with the same map anyway and compiling it again is
> redundant. Just doing that might already save a significant chunk of time.
> This should also be much easier to achieve, and if it provides a relevant
> speedup it would be great as interim solution.
> So the path is
> XkbInitKeyboardDeviceStruct:xkb/xkbInit.c
>   -> XkbDDXNamesFromRules:xkb/ddxLoad.c
>         this is where all the rules parsing happens, skipping that may
> save
>         time.
>   -> XkbDDXLoadKeymapByNames:xkb/ddxLoad.c
>         this is where xkbcomp is called with the Kcstg format. xkbcomp now
>         parses that into an xkm format
>   -> XkmReadFile:xkb/xkmread.c
>         here we read in the compiled keymap and basically copy it into the
>         internal structs.
> Cheers,
>   Peter


More information about the xorg mailing list