This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] Reduce memory usage for intrinsic masks
- From: Thomas Koenig <tkoenig at alice-dsl dot net>
- To: Dominique Dhumieres <dominiq at lps dot ens dot fr>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 07 Sep 2007 15:36:50 +0200
- Subject: Re: [patch, fortran] Reduce memory usage for intrinsic masks
- References: <20070906213425.B3BD65BB46@mailhost.lps.ens.fr>
On Thu, 2007-09-06 at 23:34 +0200, Dominique Dhumieres wrote:
Hi Dominique,
> Do you have any idea about the impact of this patch in term of speed?
It appears to be a win, at least on my home system.
The following program:
program main
integer, parameter :: asize = 50000
integer, parameter :: n = 10000
integer :: i
real, dimension(asize) :: a, b
call random_number(a)
nc = count(a>0.4)
do i=1,n
b(1:nc) = pack(a,a>0.4)
end do
end program main
Without the patch:
$ time ./a.out
real 0m15.427s
user 0m14.621s
sys 0m0.060s
With the patch:
$ time ./a.out
real 0m12.558s
user 0m12.533s
sys 0m0.000s
This is on an Athlon XP 2600+.