xkbcommon / libxkbcommon

keymap handling library for toolkits and window systems
https://xkbcommon.org
Other
286 stars 125 forks source link

Keymap compiler server #536

Open wismill opened 2 weeks ago

wismill commented 2 weeks ago

Create a keymap compiler server:

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.

wismill commented 2 weeks ago

@whot @bluetech any suggestion for profiling our code base?