News for hackers. Stuff that matters.
Re:A Sad Day for Rust by zozbot234 on Friday January 17, 2020 @11:16AM (#22075918)
Didn't the Rust stdlib just gain a high-performance hash map recently? Is there a real case for using a custom implementation in reqwest? I could see Shnatsel getting a bit frustrated wrt. that choice.
Re:A Sad Day for Rust by thramp on Friday January 17, 2020 @11:49AM (#22076334)
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.

Re:A Sad Day for Rust by quotemstr on Friday January 17, 2020 @11:36AM (#22076144)
High performance relative to what? In the highest performance code, you will always want your own data structures, ones specialized for your particular use case. Generic facilities will never be quite as good. A general purpose language must support this kind of specialization.