[patch,libfortran] [4.7/4.8/4.9 Regression] PR38199 missed optimization: I/O performance
Jerry DeLisle
jvdelisle@charter.net
Wed Mar 12 02:55:00 GMT 2014
On 03/09/2014 05:39 PM, Jerry DeLisle wrote:
> Hi all,
>
> This final patch does two things.
>
> First: In read.c it implements a simple space skipping scheme in read_decimal
> where I found a lot of repeated next_char calls happening. This gives a pretty
> good boost in performance and is applicable in general for reading integers.
>
> Second: I have taken Thomas idea of using LEN_TRIM in unit.c revised it to work
> on formatted READ. I tried to document the code with comments. There are
> certain conditions for which one can not shorten the string length for internal
> units. For arrays of characters you can not do this for strings more than rank 1
> and stride 1. Also, you can not do this any time a BLANK='zero' is being used. I
> also skip the optimization if there is any BLANK= specified in the READ. Thats
> conservative. I could also test for BLANK='NULL' in the DTP structure. I will
> probably do that later.
>
> I have added a helper function which tests for the BZ within a format string
> when a format string is present. I also check to see if the UNIT has had the
> BLANK status set. The optimization is skipped for these conditions.
>
Updated patch to resolve issue found during NIST tests.
Regression tested and NIST tested.
OK for trunk?
Regards,
Jerry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr38199-C.diff
Type: text/x-patch
Size: 3521 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140312/6b482465/attachment.bin>
More information about the Fortran
mailing list