Hacker News new | ask | show | jobs
by unlinked_dll 2350 days ago
Spitballing here, but I’d suspect a “hash table” implemented as a vector of tuples of key/value pairs with linear time search for the keys would outperform a canonical hashtable for simple JRPC APIs where the vast majority of your JSON objects have fewer than a dozen elements.

Would be interesting to build a hashtable with an equivalent “small string optimization” approach where you have a fixed sized array that is replaced by a canonical hashtable once it grows past some threshold.

1 comments

Eh, the optimization you talk about is basically how hash tables are implemented in languages like Ruby and Crystal.