Re: Algorithm Optimization

gah4 <>
Tue, 15 Sep 2020 22:25:33 -0700 (PDT)

          From comp.compilers

Related articles
Algorithm Optimization (Rick C. Hodgin) (2020-09-13)
Re: Algorithm Optimization (Elijah Stone) (2020-09-14)
Re: Algorithm Optimization (Rick C. Hodgin) (2020-09-15)
Re: Algorithm Optimization (Derek M. Jones) (2020-09-15)
Re: Algorithm Optimization (gah4) (2020-09-15)
Re: Algorithm Optimization ( (2020-09-16)
Re: Algorithm Optimization (Rick C. Hodgin) (2020-09-16)
Re: Algorithm Optimization (Derek M. Jones) (2020-09-16)
Re: Algorithm Optimization (gah4) (2020-09-16)
Re: Algorithm Optimization (Richard Harnden) (2020-09-16)
Re: Algorithm Optimization (Hans-Peter Diettrich) (2020-09-17)
[5 later articles]
| List of all articles for this month |

From: gah4 <>
Newsgroups: comp.compilers
Date: Tue, 15 Sep 2020 22:25:33 -0700 (PDT)
Organization: Compilers Central
References: 20-09-032 20-09-035
Injection-Info:; posting-host=""; logging-data="69485"; mail-complaints-to=""
Keywords: optimize, comment
Posted-Date: 16 Sep 2020 11:14:01 EDT
In-Reply-To: 20-09-035

On Tuesday, September 15, 2020 at 7:24:11 PM UTC-7, Derek M. Jones wrote:

> > I've been pursuing the idea of what I call algorithm optimization. It's
> > the idea that algorithms coded by individuals may not be optimal, and
> > may require refactoring / re-engineering to be made optimal based on
> > what's trying to be achieved.

> Compilers had done to death figuring out how best to optimize what
> the developer wrote. The future is optimizing what they intended to write.


> A while back I had the idea of trying to figure out what floating-point
> calculation was being attempted, e.g., using a Taylor series when a Chebyshev
> series would be more efficient.

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

Now, say someone is doing their CS project for class, where they are
supposed to write, and time, bubblesort?

I suppose you can find a Chebyshev series that closely approximates
the series coded, but takes fewer terms.

But what about the person who wants to compare two series'?
If you replace one or both, then the comparison will be wrong.

Not that there haven't been problems since the beginning of
optimizing compilers, where the results were different than

This is also reminding me of the optimizing compilers that
figure out the whole result at compile time, much slower than
it would be at run time. That one was from a benchmark program.
[Back when people cared about Whetstone and Dyrystone benchmarks,
compilers recognized code sequences from those benchmarks for, uh,
special processing. But it doesn't generalize very well. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.