Mail Archives: cygwin/1998/08/26/17:32:55
; I sent the folowing mail to Mr. Khan, but I suspect some other people
; might be interested so I am sending the mail here as well.(With
; modifications to make the mail abit more understandable)
; Best Regards
; Toshiyuki
; nakata AT ccm DOT cl DOT nec DOT co DOT jp
; ------- Forwarded Message
;
; I have one question on performance related issue.
;
; Do you support -malign-double in mingwin-32 and gnuwin-32 (egcs-1.0.2)?
;
; The reason is that I have been comparing the performance of a user's
; application on linux and Winnt and the interesting thing to note is that
;
; They are comparable for integer performance but linux performance is
; about 20% better for floating point intensive application.
Sorry, it seems that this has been fixed for the egcs1.0.2 for gnuwin32 b19
but not for egcs1.0.2 on ming32.
In a nutshell, older versions (as well as the current mingw32 version)
did not seem to have aligned the common blocks on an 8 word boundary.
if you compile the following 2 files by
gcc -c tm.c
g77 -O -malign-double a.f tm.o
and then do
nm a.exe | egrep xx
then on egcs ver 1.0.2 on mingwin32 I get,
0040a000 b _xx.4
0040f28c B _xx1_
004111d4 B _xx2_
0040d344 B _xx3_
0040b3fc B _xx4_
while on cygwin-32 b19 + egcs 1.0.2, I get
0040a000 b _xx.4
0040f330 B _xx1_
004102d8 B _xx2_
0040d3e8 B _xx3_
0040b4a0 B _xx4_
And the timing values in millisecs
differ. ( I would like to have the no. 1 and no. 3 faster than no.2 and no.4)
-----a.f
program main
implicit double precision (a-h,o-z)
common /xx1/ list1(2002)
common /xx2/ list2(2002)
common /xx3/ dlist1(1001)
common /xx4/ dlist2(1001)
dimension list3(3)
equivalence (dlist2(1), list3(1))
call milltimer(is)
call sub(list1(1),dble(0.2))
call milltimer(ie)
call sub(list2(2),dble(0.2))
call milltimer(if)
call sub(dlist1,dble(0.2))
call milltimer(ix)
call sub(list3(2),dble(0.2))
call milltimer(iy)
write(*,*), ie-is,if-ie,ix-if,iy-ix
stop
end
subroutine sub(d,ds)
implicit double precision (a-h,o-z)
dimension d(1000)
do i=1,100000
do j=1,1000
d(j)= ds
d(j+1)=d(j)*ds
end do
end do
return
end
-----------tm.c
#include <sys/timeb.h>
milltimer_(itime)
int *itime;
{
struct timeb mytime;
int ires;
/* gettimeofday( &mytime, 0);*/
ftime(&mytime);
ires= 1000* (mytime.time & 0xffff) + (mytime.millitm);
*itime=ires;
}
Best Regards
Toshiyuki Nakata
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -