Really slow direct unformatted output under MS Windows:(

Delbert Franz ddf@iqdotdt.com
Wed Nov 9 21:24:00 GMT 2011


I have been doing some test runs of gfortran, 4.6.1, under MS Windows, 
mingw option.  The last time I did this, gfortran was nearly 
equivalent to the old Lahey f95 compiler I still have lurking on MS 
Windows, running in a virtual machine with VmWare 7.x, but only if the 
executable had minimal formatted input or output.  Now I had a test 
case that writes over 1 GB using the direct unformatted write option.  
The output is really in record-number order when the file is being 
written.  I was astounded to see how doing these writes increased the 
runtime for the executable created by gfortran.  
  
Here are the results:
  
Compiler    Write large        Run time
used         direct file       (seconds)
---------   ------------       ---------
Lahey f95       no              124
Lahey f95      yes              136

gfortran        no              104
gfortran       yes              636

Note that without writing the large file, gfortran produces an 
executable for me that is about 20 per cent faster then does the f95 
compiler.  However, when the large file is written, f95 only increases 
by 12 seconds whereas gfortran increases by more than a factor of 5!  

I was seeking to recommend gfortran to a client but with this slowing 
when writing a large file using fixed length unformatted records that 
are several thousand bytes long each, makes me hesitate.  Are there 
some compile-time or runtime-options that could reduce the large 
increase in runtime?  In a quick scan, I did not find any but then 
there are so many options in gcc that I'm not sure if I have really 
looked in the correct locations:) 

I did find some recent activity on the mailing list about release 
4.7.0 and slow I/O.  Perhaps the issue is under active review.  I hope 
that some resolution can be reached because a factor of five increase 
in runtime for I/O seems to be somewhat larger than is reasonable.  

Thanks, 

       Delbert



More information about the Fortran mailing list