Re:Bubble Sort: An Archaeological Algorithmic Analysis
by tmoertel on Tuesday February 05, 2019 @07:59PM
(#19091719)
I have an amusing archaeological anecdote about the bubble sort.
Around 1990, on my first real job out of college, I was assigned about 100K lines of C code to maintain. I was told that it had problems scaling up to larger networks (it was a network mapping system).
While going through the code, I discovered that it contained a bubble sort that had been commented out. The comments said that it had been replaced with hand-rolled sorting logic in 68K assembly for "additional speed."
So I found the assembly code for the new sorting logic. It was also a bubble sort!
In disbelief, I replaced all this nonsense with a call to the standard library's `qsort` function. The scaling problems disappeared :-)
Around 1990, on my first real job out of college, I was assigned about 100K lines of C code to maintain. I was told that it had problems scaling up to larger networks (it was a network mapping system).
While going through the code, I discovered that it contained a bubble sort that had been commented out. The comments said that it had been replaced with hand-rolled sorting logic in 68K assembly for "additional speed."
So I found the assembly code for the new sorting logic. It was also a bubble sort!
In disbelief, I replaced all this nonsense with a call to the standard library's `qsort` function. The scaling problems disappeared :-)