Re: Book on low level program optimization
- From: beliavsky@xxxxxxx
- Date: 29 May 2005 05:11:05 -0700
Niels L. Ellegaard wrote:
>Can anybody recommend a book or a nice set of lecture notes on
>lowlevel program optimization for numerical programs?
Not exactly what you asked for, but hardware companies publish papers
and sell libraries to help programmers optimize performance. There is
information for Intel at
http://www.intel.com/software/products/index.htm?iid=Corporate+Header_prod_softwr&
and AMD at
http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_2282,00.html
..
Whether optimizing a code by hand will improve performance partly
depends on how smart the compiler is, and by now most Fortran compilers
are pretty smart.
<snip>
> What is the cost of different mathematical operations? (addition
> multiplication ect)
It can take more time to access the variables used in the arithmetic
operations than to perform the operation. I once found that computing
sum(x) and sum(x**4) took about the same time for a large REAL vector
x. Intrinsic functions such as the exponential can be expensive to
calculate.
>
> When is it harmful to place an if-then structure within a fast loop?
>
This was discussed about a year ago in a comp.lang.fortran thread
"speed of tests in loops" that you can find using Google.
.
- References:
- Book on low level program optimization
- From: Niels L. Ellegaard
- Book on low level program optimization
- Prev by Date: Re: Book on low level program optimization
- Next by Date: auto generation of make files, best location for tests
- Previous by thread: Re: Book on low level program optimization
- Next by thread: Re: Book on low level program optimization
- Index(es):