News for hackers. Stuff that matters.
Re:Efficiency is dangerous and slowing down makes life better by Retric on Friday August 21, 2020 @03:41PM (#24238180)
Plenty of n log n operations are in constant space. Average Quicksort performance being perhaps the classic example. But most often you see these kinds of improvements by simply removing steps. Net result is less code, less memory use age, less of everything.
Re:Efficiency is dangerous and slowing down makes life better by hansvm on Friday August 21, 2020 @04:07PM (#24238404)
Yep, I'm not arguing that it's always a good idea (or even usually...or even that I've seen it be a good idea in the wild), just that it could be. Taking quicksort as an example, it's only constant space if you're allowed/able to mutate in-place. If you need (for some bizarre reason) to stream sorted results in constant space without mutating the underlying data then you'll need some other tool.