[Bug libfortran/38199] [4.7/4.8/4.9 Regression] missed optimization: I/O performance

jvdelisle at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Nov 10 22:08:00 GMT 2013


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

--- Comment #27 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Getting my self up to speed here.  I reviewed what we have going on with this. 
Currently we call a function called eat_spaces to do what is needed. 
Naturally, to keep track of all the flags and counters, eat_spaces just calls
next_char.

next_char handles all the details, but is not optimized to just skip over
spaces.

If we wanted to break our paradigm, we could go straight to memory and just
scan the string and skip the spaces.  Another option is to use the sread call
which goes straight to mem_read in unix.c

Another option would be to not even store the spaces and use a NULL marker and
then pad spaces on writes when we see it and stop reads.  This would be most
efficient, but is a very intrusive and could lead to problems when accessing
the middle of strings, etc, etc, etc.

I will be attempting to use sread in a better way for eat_spaces and see how it
turns out.



More information about the Gcc-bugs mailing list