Re: fast array assignement
robert.corbett_at_sun.com
Date: 02/07/05
- Next message: Greg Lindahl: "Re: Newbie Question about Fortran speed"
- Previous message: ejko123_at_yahoo.com: "Re: Part 2 of Short Steps Toward Generic Programming: Specification Assertions"
- In reply to: Ron Shepard: "Re: fast array assignement"
- Next in thread: James Van Buskirk: "Re: fast array assignement"
- Reply: James Van Buskirk: "Re: fast array assignement"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 6 Feb 2005 21:04:07 -0800
> It is surprising
> to me that now, almost 15 years after array syntax was standardized
> in the language, optimizers aren't doing a better job with array
> syntax.
It is no surprise to me. Optimizing array expressions is hard.
Consider an example that was presented before on c.l.f.
Someone wanted to know why the expression
COUNT( (/ a, b, c, d /) ) == 4
where a, b, c, and d are logical expressions took longer to execute
than
a .and. b .and. c .and. d
Most compilers figure out that the array constructor has a small
fixed-size value, and so dynamic allocation is unnecessary. A few
understand that evaluating the count does not require storing the
elements of the constructor. If any compiler does the transformation
into logical conjunctions, it is because a special case was tossed in
as a result of the earlier posting on c.l.f.
Sincerely,
Bob Corbett
- Next message: Greg Lindahl: "Re: Newbie Question about Fortran speed"
- Previous message: ejko123_at_yahoo.com: "Re: Part 2 of Short Steps Toward Generic Programming: Specification Assertions"
- In reply to: Ron Shepard: "Re: fast array assignement"
- Next in thread: James Van Buskirk: "Re: fast array assignement"
- Reply: James Van Buskirk: "Re: fast array assignement"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|