libxkbcommon
libxkbcommon copied to clipboard
Keymap compiler server
Create a keymap compiler server:
- Cache keymap components right after parsing (
XkbFile) - Propose a thread-safe atom table variant
- Use Unix sockets to serve keymap compiler service
This speeds up the xkeyboard-config test by about 5x.
Unfortunately, this adds a fair amount of code, in particular in ast-build.c. I am not sure we are willing to commit to such addition for only this particular use case. Given the include mechanism and the interaction between components, I do not see how to cache things in a better/easier way. Maybe mmaping all files beforehand could save us costly storage reads.
Anyway, this was a good experience for me to understand better our source code, experiment with thread-safe structures and Unix sockets in C.
@whot @bluetech any suggestion for profiling our code base?