News for hackers. Stuff that matters.
Re:Decreasing the Number of Memory Accesses 1/2 by pclmulqdq on Friday March 31, 2023 @12:25PM (#35389439)
People usually underestimate where that line is. In my past experience, I ended up benchmarking binary search vs linear search on a collection of small objects. The breakeven point on a modern CPU was at 10 megabytes of data. Although this is a particularly extreme example, most people assume that collections of a few thousand items are where you should switch to big-O-optimal algorithms, but the breakeven is usually several orders of magnitude higher.
Re:Decreasing the Number of Memory Accesses 1/2 by AgentOrange1234 on Friday March 31, 2023 @04:22PM (#35393068)
That’s very surprising to me. My intuition screams that surely a binary search is competitive with a linear search even at small sizes. I would love to see benchmarks and code for this if you have them handy.