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

The Rust BTreeMap implementation is an example of this as well. It does a linear scan through the nodes instead of a binary search because it's actually faster in this case!

https://doc.rust-lang.org/std/collections/struct.BTreeMap.ht...



Did we both just watch the latest Crust of Rust, or did you just know that? If the latter, I’m impressed!


>Did we both just watch the latest Crust of Rust

Yes that's exactly how I knew about this!


Interesting. But the doc doesn't go as far as to say it's faster, just fast - any measurements for eg string keys?


I can't seem to find any benchmarks for this but Gankra did a long write up about Rust's btree implementation!

I did not read this entire thing so it's very possible it contains a benchmark somewhere but I couldn't find any when doing a quick skim.

https://faultlore.com/blah/rust-btree-case/




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

Search: