src/ks_tables.h


Log

Author Commit Date CI Message
Ran Benita 45b1ca22 2021-04-01T22:46:56 keysym: speed up the perfect hash function Make it use a bit operation instead of an expensive modulo. perf diff: Baseline Delta Abs Shared Object Symbol ........ ......... ................. ................................... 28.15% -6.57% bench-compose [.] xkb_keysym_from_name Signed-off-by: Ran Benita <ran@unusedvar.com>
Ran Benita 68e69b7d 2021-03-28T20:22:54 keysym: use a perfect hash function for case sensitive xkb_keysym_from_name In 7d84809fdccbb5898d0838849ec7c321410182d5 I added a fast path for the case-sensitive case, but it is still slowing down Compose parsing. Instead of the binary search, use a perfect hash function, computed with a simple python module I found (vendored). It is faster -- perf diff is: Baseline Delta Abs Shared Object Symbol ........ ......... ................. ................................... 22.35% -14.04% libc-2.33.so [.] __strcmp_avx2 16.75% +10.28% bench-compose [.] xkb_keysym_from_name 20.72% +2.40% bench-compose [.] parse.constprop.0 2.29% -1.97% bench-compose [.] strcmp@plt 2.56% +1.81% bench-compose [.] resolve_name 2.37% +0.92% libc-2.33.so [.] __GI_____strtoull_l_internal 26.19% -0.63% bench-compose [.] lex 1.45% +0.56% libc-2.33.so [.] __memchr_avx2 1.13% -0.31% libc-2.33.so [.] __strcpy_avx2 Also reduces the binary size: Before: text data bss dec hex filename 341111 5064 8 346183 54847 build/libxkbcommon.so.0.0.0 After: text data bss dec hex filename 330215 5064 8 335287 51db7 build/libxkbcommon.so.0.0.0 Note however that it's still larger than before 7d84809fdccbb5898d08388: text data bss dec hex filename 320617 5168 8 325793 4f8a1 build/libxkbcommon.so.0.0.0 Signed-off-by: Ran Benita <ran@unusedvar.com>
Ran Benita 7d84809f 2021-03-28T15:51:01 keysym: fast path for case sensitive xkb_keysym_from_name xkb_keysym_from_name() is called a lot in Compose file parsing. The lower case handling slows things down a lot (particularly given we can't use the optimized strcasecmp() due to locale issues). So add separate handling for the non-case-sensitive case which is used by Compose. To do this we need to add another version of the ks_tables table. This adds ~20kb to the shared library binary. We can probably do something better here but I think it's fine. Signed-off-by: Ran Benita <ran@unusedvar.com>
Peter Hutterer 0bfc71e7 2021-02-22T08:20:40 Update keysym definitions to latest xorgproto As of xorgproto commit e5d8af9711516385f8346c9e077692b29c914478 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Ran Benita 892cfef8 2020-05-20T20:42:02 keysyms: add XKB_KEY_XF86FullScreen Updated using ./scripts/update-keysyms using latest xorgproto. Fixes: https://github.com/xkbcommon/libxkbcommon/issues/147 Signed-off-by: Ran Benita <ran@unusedvar.com>
Ran Benita 670566f0 2019-12-27T15:03:10 Only add GCC diagnostic pragmas when compiler is GCC compatible Avoid "unknown pragma" warnings on other compilers. Signed-off-by: Ran Benita <ran@unusedvar.com>
Hans de Goede 9b85d96d 2019-01-22T08:31:43 Sync Keysyms with recent xproto additions xproto recently has been extended with 2 new keysyms: XF86XK_MonBrightnessCycle XF86XK_RotationLockToggle This commit is the result of running "scripts/update-keysyms" on a system with the updated xproto installed. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Hans de Goede 939d0909 2017-05-10T14:46:03 Sync Keysyms with recent xproto additions xproto recently has been extended with 4 new keysyms: XF86XK_Keyboard XF86XK_WWAN XF86XK_RFKill XF86XK_AudioPreset This commit is the result of running "make update-keysyms" on a system with the updated xproto installed. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Ran Benita 1d5ae226 2014-01-11T00:26:58 makekeys: mark keysym_names as static Signed-off-by: Ran Benita <ran234@gmail.com>
Jasper St. Pierre 0628b9b2 2014-01-01T13:01:12 makekeys: Add a gcc pragma to ignore -Woverlength-strings
Jasper St. Pierre eef3ab23 2013-07-17T18:56:03 makekeys: Put a comment describing the origin of the file
Jasper St. Pierre 68c61e7f 2013-07-17T18:07:31 ks_tables: Put all keysym names in one giant block This makes the file take two segments instead of potentially many, causing relocation issues.
Ran Benita 53e7a135 2014-01-01T10:40:09 keysyms: add German T3 layout keysyms from xproto Reference: http://cgit.freedesktop.org/xorg/proto/xproto/commit/?id=6d4acb0e3a6568a8faaa651d4e3d32f917b9067b Signed-off-by: Ran Benita <ran234@gmail.com>
Daniel Stone 6bb727b2 2013-07-17T22:46:48 Resync keysym database xproto 7.0.24 adds XF86AudioMicMute. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Ran Benita 5d9a5cb0 2012-10-17T19:52:47 Commit and distribute ks_tables.h The ks_tables.h file is generated by makekeys.py from xkbcommon-keysyms.h, which in turn is generated initially by 'make update-keysyms'. The xkbcommon-keysyms.h file is commited to git and distributed in the tarball. Since ks_tables.h should only ever change when xkbcommon-keysyms.h changes, it is more sensible to update them together and treat them the same, instead of generating ks_tables.h every time for every builder with 'make', as we do now. This means we don't need python as a build dependency (only the one running update-keysyms, i.e. no one, needs this), and we can be sure exactly the same file is used by everyone. We also don't need to run makekeys.py on every build. Signed-off-by: Ran Benita <ran234@gmail.com>