News for hackers. Stuff that matters.
Re:Why databases use ordered indexes but programming uses ha... by whack on Monday December 09, 2019 @07:16PM (#21748255)
> Essentially I don’t think it’s really enough to consider the asymptotic complexity of algorithms to compare practical runtimes. You need to know what the smaller-order / constant terms are.

Nitpick: even if you know the constant terms, that would only tell you the number of operations required to execute the code. That's not enough to compare runtimes, because runtimes are also impacted by other factors like branch prediction rate and cache hit rate. You need to consider those factors as well, in order to compare runtimes.

At some point, articles become completely unreadable when they try to address every possible nitpick. Some tangents are better left unexplored in a blog post.

Re:Why databases use ordered indexes but programming uses ha... by travisjungroth on Monday December 09, 2019 @08:07PM (#21748623)
This is why benchmarking can be useful. I’m not sure why in a field where the materials cost of testing an idea is zero it’s done so much less frequently than theorizing.
Re:Why databases use ordered indexes but programming uses ha... by naniwaduni on Monday December 09, 2019 @10:31PM (#21749347)
The real costs of testing are clearly nonzero.

If they were zero, the testing would already be done.

Re:Why databases use ordered indexes but programming uses ha... by travisjungroth on Tuesday December 10, 2019 @10:41AM (#21753457)
Real costs are certainly more than zero, but it’s almost entirely time. “Materials cost” is what I rounded off to zero. Like if you want to benchmark an idea in aviation, you’re going to have to burn some fuel.
Re:Why databases use ordered indexes but programming uses ha... by jtc331 on Tuesday December 10, 2019 @06:59AM (#21751657)
Maybe because that commits you to a specific implementation with all of its particular choices instead of being able to compare the class of problems and solutions.

Edit: Typo.