diff options
author | Ran Benita <ran@unusedvar.com> | 2020-11-19 00:28:37 +0200 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2020-11-20 13:04:21 +0200 |
commit | 1bd3b3c7cb52ae77667d45cb46e8b5af3046a8d7 (patch) | |
tree | 067bb54b2daf23dcef11c24aed3ac8b65f8c4d9c /meson.build | |
parent | f41e609bbea8447fc82849a1a6ea0d116189f2f8 (diff) | |
download | libxkbcommon-1bd3b3c7cb52ae77667d45cb46e8b5af3046a8d7.tar.gz libxkbcommon-1bd3b3c7cb52ae77667d45cb46e8b5af3046a8d7.tar.bz2 libxkbcommon-1bd3b3c7cb52ae77667d45cb46e8b5af3046a8d7.zip |
x11: cache X11 atoms
On every keymap notify event, the keymap should be refreshed, which
fetches the required X11 atoms. A big keymap might have a few hundred of
atoms.
A profile by a user has shown this *might* be slow when some intensive
amount of keymap activity is occurring. It might also be slow on a
remote X server.
While I'm not really sure this is the actual bottleneck, caching the
atoms is easy enough and only needs a couple kb of memory, so do that.
On the added bench-x11:
Before: retrieved 2500 keymaps from X in 11.233237s
After : retrieved 2500 keymaps from X in 1.592339s
Signed-off-by: Ran Benita <ran@unusedvar.com>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/meson.build b/meson.build index f3b58e1..c815578 100644 --- a/meson.build +++ b/meson.build @@ -701,6 +701,13 @@ benchmark( executable('bench-compose', 'bench/compose.c', dependencies: test_dep), env: bench_env, ) +if get_option('enable-x11') + benchmark( + 'x11', + executable('bench-x11', 'bench/x11.c', dependencies: x11_test_dep), + env: bench_env, + ) +endif # Documentation. |