From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8062 invoked by alias); 12 Mar 2014 15:16:09 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 7998 invoked by uid 48); 12 Mar 2014 15:16:04 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/38199] [4.7/4.8/4.9 Regression] missed optimization: I/O performance Date: Wed, 12 Mar 2014 15:16:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Version: 4.4.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: jvdelisle at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-03/txt/msg00983.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38199 --- Comment #41 from Dominique d'Humieres --- > Created attachment 32335 [details] > Updated patch taking care of NIST failures and cleaned up > > This patch regression tests and passes NIST on x86-64. I have restructured it > and took care of leaping on uninitialized values. > > Dominiq. Can you give it a spin? Thanks Confirmed. Now the two test in comment 35 execute in ~0.1s. Note that the test character buffer(1)*100000 integer i,j buffer = '' buffer(1)(6:100000) = repeat('a',99995) DO j=1,9999 write(buffer(1)(1:4),'(i4)') j read(buffer,*) i ENDDO print *, "'",buffer(1)(1:10), '...', buffer(1)(99990:100000), "'" end obviously does not benefit of the speed-up due to the trimming: [Book15] f90/bug% time a.out '9999 aaaaa...aaaaaaaaaaa' 11.380u 0.007s 0:11.38 100.0% 0+0k 0+1io 0pf+0w Without the patch, the run time is slightly shorter: [Book15] f90/bug% time a.out '9999 aaaaa...aaaaaaaaaaa' 10.617u 0.001s 0:10.61 100.0% 0+0k 0+0io 0pf+0w One possibility would be to "go to end" as soon as the value(s) is(are) read. This would also fix pr58324 and pr59727.