https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91030

--- Comment #15 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
(In reply to David Edelsohn from comment #13)
> Why should -fconvert affect the strategy for writing?

If we get passed a contiguous block of memory (like in
your test case) we can do this in a single write.

If we want to swap bytes, this needs to be done on a basis
of each data item. It would be wasteful to write out each
data item by itself, so do this by copying to a buffer until it
is full, and then writing out the buffer.

The effect on speed could be tested simply enough. Just write
two test programs, one of them mimicking the current behavior of
libgfortran (writing out 8192 byte blocks, possibly starting with
a smaller size) and the other one with one huge write.  Use the
write() system call directly. Benchmark both.

Reply via email to