Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The reason the `http` crate has a "bespoke hashmap implementation" is not because "performance", it's because _HTTP headers call for different behavior than `std::collections::HashMap`_. Some of the differences in behavior include:

- The map needs to be a multimap.

- Insertion order needs to be preserved.

While `std::collections::HashMap` is an excellent HashMap, it is not a good fit for HTTP headers.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: