example of hash as alternative to switch

it's slower when using an anonymous hash, as we build a hash only to
throw it away, but if we turn that anon hash into a state variable it
is the quickest of them all:

                 Rate   anon_hash      switch     if_else hash_cached
anon_hash    643110/s          --        -74%        -87%        -88%
switch      2435850/s        279%          --        -52%        -55%
if_else     5068698/s        688%        108%          --         -7%
hash_cached 5461333/s        749%        124%          8%          --