News for hackers. Stuff that matters.
Re:Static search trees: 40x faster than binary search by amelius on Wednesday January 01, 2025 @06:25PM (#42570163)
Using a Vec for doubly linked lists sounds like overkill. There's got to be more efficient and more elegant way.
Re:Static search trees: 40x faster than binary search by unrealhoang on Wednesday January 01, 2025 @07:08PM (#42570384)
Yes, there is, just use plain old pointers. Who cares about UB anyway.
Re:Static search trees: 40x faster than binary search by thayne on Thursday January 02, 2025 @04:02AM (#42572862)
Using a Vec actually has some benefits beyond the safety guarantees from rust. There are fewer allocations, and you probably are more likely to get nearby nodes on the same cache line.