|[9 earlier articles]|
|Re: Algorithm Optimization firstname.lastname@example.org (Richard Harnden) (2020-09-16)|
|Re: Algorithm Optimization DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2020-09-17)|
|Re: Algorithm Optimization email@example.com (Thomas Koenig) (2020-09-17)|
|Re: Algorithm Optimization firstname.lastname@example.org (A. K.) (2020-09-21)|
|Re: Algorithm Optimization DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2020-12-13)|
|Re: Algorithm Optimization email@example.com (gah4) (2020-12-20)|
|Re: Algorithm Optimization firstname.lastname@example.org (Johann 'Myrkraverk' Oskarsson) (2021-04-21)|
|From:||"Johann 'Myrkraverk' Oskarsson" <email@example.com>|
|Date:||Wed, 21 Apr 2021 16:29:30 +0000|
|References:||20-09-032 20-09-035 20-09-036|
|Injection-Info:||gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="8258"; mail-complaints-to="firstname.lastname@example.org"|
|Posted-Date:||21 Apr 2021 12:40:15 EDT|
On 16/09/2020 5:25 am, gah4 wrote:
> I think I remember this being discussed many years ago.
> One thought was that someone codes bubblesort, and the compiler
> generates quicksort. Small complication that bubblesort is stable, and
> quicksort isn't. (Add an array with the original position to break
Here are even more dragons.
What if you're sorting exactly three elements? In that situation, I'll
be very surprised if bubblesort doesn't outperform all other algorithms.
How does the /compiler/ decide that an algorithm is better, based
on data it never sees? Even if we account for profile guided optimi-
zations, we shouldn't allow the compiler to adjust for /what if this is
run with more data in production?/ kind of questions.
If you want to go down this rabbit hole, I'd much prefer warnings than
outright algorithm changes.
I'm not from the internet, I just work there.
Return to the
Search the comp.compilers archives again.