Re: Algorithm Optimization

gah4 <gah4@u.washington.edu>
Tue, 15 Sep 2020 22:25:33 -0700 (PDT)

          From comp.compilers

Related articles
Algorithm Optimization rick.c.hodgin@gmail.com (Rick C. Hodgin) (2020-09-13)
Re: Algorithm Optimization elronnd@elronnd.net (Elijah Stone) (2020-09-14)
Re: Algorithm Optimization rick.c.hodgin@gmail.com (Rick C. Hodgin) (2020-09-15)
Re: Algorithm Optimization derek@_NOSPAM_knosof.co.uk (Derek M. Jones) (2020-09-15)
Re: Algorithm Optimization gah4@u.washington.edu (gah4) (2020-09-15)
Re: Algorithm Optimization mwmarkland@gmail.com (mwmarkland@gmail.com) (2020-09-16)
Re: Algorithm Optimization rick.c.hodgin@gmail.com (Rick C. Hodgin) (2020-09-16)
Re: Algorithm Optimization derek@_NOSPAM_knosof.co.uk (Derek M. Jones) (2020-09-16)
Re: Algorithm Optimization gah4@u.washington.edu (gah4) (2020-09-16)
Re: Algorithm Optimization richard.nospam@gmail.com (Richard Harnden) (2020-09-16)
Re: Algorithm Optimization DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2020-09-17)
[5 later articles]
| List of all articles for this month |

From: gah4 <gah4@u.washington.edu>
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: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="69485"; mail-complaints-to="abuse@iecc.com"
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.


(snip)


> 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
ties.)


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
expected.


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.