You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
allkeywords: replace switch with map in GetKeywordID
Long time ago in 74f630c we switched
the implementation of keyword ID lookup in lexer from the map to a large
generated switch. At that time it was more performant, but with the new
swiss table implementation of hash maps in Go I was curious to see
whether the map approach is now faster, and it turns out to be so, so
this commit switches back to the map lookup.
```
name old time/op new time/op delta
Parse/simple-8 12.4µs ± 0% 12.1µs ± 0% -2.05% (p=0.000 n=8+9)
Parse/string-8 18.2µs ± 0% 18.0µs ± 0% -1.24% (p=0.000 n=10+9)
Parse/tpcc-delivery-8 25.0µs ± 0% 24.5µs ± 0% -1.73% (p=0.000 n=10+10)
Parse/account-8 32.9µs ± 0% 32.2µs ± 0% -2.14% (p=0.000 n=10+10)
name old alloc/op new alloc/op delta
Parse/simple-8 3.56kB ± 0% 3.56kB ± 0% ~ (all equal)
Parse/string-8 3.83kB ± 0% 3.83kB ± 0% ~ (all equal)
Parse/tpcc-delivery-8 6.14kB ± 0% 6.14kB ± 0% ~ (all equal)
Parse/account-8 11.2kB ± 0% 11.2kB ± 0% ~ (all equal)
name old allocs/op new allocs/op delta
Parse/simple-8 22.0 ± 0% 22.0 ± 0% ~ (all equal)
Parse/string-8 26.0 ± 0% 26.0 ± 0% ~ (all equal)
Parse/tpcc-delivery-8 41.0 ± 0% 41.0 ± 0% ~ (all equal)
Parse/account-8 75.0 ± 0% 75.0 ± 0% ~ (all equal)
```
Release note: None
0 commit comments