2x faster than std::HashMap for immuatable Maps of <100 keys ..fun with SIMD
I've been learning Rust in the last few weeks by building a jsonl schema validator (it doesn't check for valid json, rather it checks that the json matches a user-supplied schema).*
As part of that I got very into building SIMD optimisations, e.g. using SIMD to decide how long a double-quoted string is (while still properly dealing with arbitrary-length escape sequences..that was fun!). But it turns out that mapping from key names to field metadata is relatively slow. So I started playing around with different types of Map, and ended up building one of my own.
I've open sourced a slightly less opionated version of my Map concept here - https://github.com/d1manson/rust-simd-psmap.
Not sure to what extent this is (a) novel; (b) useful to anyone; (c) bug-free, but do let me know if you like it ;)!
*I am hoping to finish up the jsonl schema validator soon and open source that too.