Hacker News new | ask | show | jobs
by xnorswap 165 days ago
I really enjoyed this article. The storing in-place of a prefix is a neat idea for faster matching/sorting.

I wonder if they also have the concept of a reverse string which stores the (reversed) suffix instead and stores the short strings backward.

Niche, but would be fast for heavy ends-with filters.

1 comments

If you want to improve equality matching for longer strings, you could even store a 4B hash of the entire string instead of the prefix. I guess that should work well if you equality match on URLs since their prefix is always "http".