This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, libgfortran] PR 56981 Flush buffer at record boundaries


On 06/06/2014 07:47 PM, Janne Blomqvist wrote:
> PING
> 
> On Tue, May 27, 2014 at 11:50 PM, Janne Blomqvist
> <blomqvist.janne@gmail.com> wrote:
>> Hi,
>>
>> the attached patch implements the idea in
>> https://gcc.gnu.org/ml/fortran/2013-04/msg00258.html ; though it
>> turned out it was much simpler than what I envisaged back then. With
>> this patch, we no longer seek back and forth when writing small
>> records with sequential unformatted, which previously happened due to
>> the buffer filling up when not on record boundaries.
>> Performance-wise, I didn't really see any difference on Linux/tmpfs,
>> but maybe it makes a difference in other circumstances. And of course,
>> as a side-effect, it makes sequential unformatted work on unseekable
>> devices such as pipes as long as the records are small, although I'm
>> not sure this is something we want to advertise to users.
>>
>> Regtested on x86_64-unknown-linux-gnu, Ok for trunk?
>>
>> 2014-05-27  Janne Blomqvist  <jb@gcc.gnu.org>
>>
>>     PR libfortran/56981
>>     * io/unix.h (struct stream_vtable): Add new member function,
>>     markeor.
>>     (smarkeor): New inline function.
>>     (flush_if_unbuffered): Remove prototype.
>>     * io/unix.c (raw_markeor): New function.
>>     (raw_vtable): Initialize markeor member.
>>     (buf_markeor): New function.
>>     (buf_vtable): Initialize markeor member.
>>     (mem_vtable): Likewise.
>>     (mem4_vtable): Likewise.
>>     (flush_if_unbuffered): Remove function.
>>     * io/transfer.c (next_record): Call smarkeor instead of
>>     flush_if_unbuffered.
>>
>>
>> --
>> Janne Blomqvist
> 
> 
>

OK, thanks for patch.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]