This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, fortran] Reduce memory usage for intrinsic masks


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]