[Bug libfortran/38199] [4.7/4.8/4.9 Regression] missed optimization: I/O performance
dominiq at lps dot ens.fr
gcc-bugzilla@gcc.gnu.org
Wed Mar 12 15:16:00 GMT 2014
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38199
--- Comment #41 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> 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.
More information about the Gcc-bugs
mailing list