keysym: speed up the perfect hash function
authorRan Benita <ran@unusedvar.com>
Thu, 1 Apr 2021 19:46:56 +0000 (22:46 +0300)
committerRan Benita <ran@unusedvar.com>
Thu, 1 Apr 2021 19:52:59 +0000 (22:52 +0300)
commit45b1ca22052b79c83bd96b7c5828add156768b8e
treed24d9e793fd8d0c4cf40c07858b1e9ff75ff5f2c
parent8cd688c06378ebdb2def6f310fb1e78898b75bde
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>
scripts/perfect_hash.py
src/ks_tables.h