public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/38199]  New: missed optimization, regression: I/O performance
@ 2008-11-20 13:57 manfred99 at gmx dot ch
  2008-11-20 14:06 ` [Bug fortran/38199] " jb at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: manfred99 at gmx dot ch @ 2008-11-20 13:57 UTC (permalink / raw)
  To: gcc-bugs

With

!234567
      character buffer*10000000
      integer i,j

      DO j=1,20
        write(buffer,'(i2)') j
        write(*,*) buffer(1:2)
        read(buffer,*) i
        write(*,*) i
      ENDDO
      end

I get the following timings:
ifort11 (64bit):               0.306s
ifort9 (32bit):                0.562s
g77 (32bit):                   2.786s
gfortran4.3 (64bit):           3.906s
gfortran4.4 (20081120, 64bit): 4.832s


Even worse:
!234567
      character buffer*100000
      integer i,j

      DO j=1,9999
        write(buffer,'(i4)') j
        write(*,*) buffer(1:4)
        read(buffer,*) i
        write(*,*) i
      ENDDO
      end

ifort11 (64bit):                0.458s
g77 (32bit):                   13.283s
gfortran4.3 (64bit):           19.362s
gfortran4.4 (20081120, 64bit): 23.917s


This is a very realistic real-world scenario when reading
in a flat-file of unknown width (<100000 assumed), and
then processing the received string buffer, i.e. doing
    100 read(10,'(a)',END=999) buffer
        ---> 
        read(buffer,*,END=101,ERR=101) array
    101 do something when unexpected content
        GOTO 100
    999 end


-- 
           Summary: missed optimization, regression: I/O performance
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: manfred99 at gmx dot ch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38199


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-02-21 15:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-20 13:57 [Bug fortran/38199] New: missed optimization, regression: I/O performance manfred99 at gmx dot ch
2008-11-20 14:06 ` [Bug fortran/38199] " jb at gcc dot gnu dot org
2008-11-20 15:00 ` manfred99 at gmx dot ch
2008-11-20 15:58 ` [Bug fortran/38199] [4.4 regression] " burnus at gcc dot gnu dot org
2008-11-20 16:11 ` manfred99 at gmx dot ch
2008-11-21  4:15 ` jvdelisle at gcc dot gnu dot org
2008-11-21 13:55 ` [Bug fortran/38199] missed optimization: " pault at gcc dot gnu dot org
2008-11-22  5:35 ` jvdelisle at gcc dot gnu dot org
2010-02-13  6:39 ` jvdelisle at gcc dot gnu dot org
2010-02-13  6:40 ` jvdelisle at gcc dot gnu dot org
2010-02-21 15:59 ` jvdelisle at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).