3 ms·
How often do you really need those interesting structures(and the memory fragmentation that comes with them)? I've seen countless times where a developer reache
by vvanders 10y ago
How often do you really need those interesting structures(and the memory fragmentation that comes with them)? I've seen countless times where a developer reached for std::hash_map/linked_list when there will never be more than 10 values in their dataset. In that case an array would be at least as fast and much easier on your data layout.
Also if you're trying to implement lockfree data structures then safe/unsafe pointer access are going to be the least of your worries :).
- charles-salvia 10y agoWhen you need them you really need them. A Patricia Trie for example, which includes back pointers to ancestor nodes, is simply an ideal structure for prefix search.
- Manishearth 10y agoHow about a rephrasing: how many times do you really need to write these? Rust will make it tricky to implement these, but then you can use the datastructure safely as much as you want. It's a "write once use everywhere" thing.
- jstimpfle 10y agoUsually there's no good library that fits your use case. There's always subtle differences (to quote John Carmack) Or it's really hard to find the good one amongst a hundred bad ones (to paraphrase ESR, when he tried Rust in all seriousness). "Write once use everywhere" is wishful thinking, it's important to make adaptions (to paraphrase Knuth).
- fanf2 10y agoCheck out qp tries http://dotat.at/prog/qp http://dotat.at/prog/qp for something rather more compact than Patricia tries