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

--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to David Edelsohn from comment #10)
> With EXT4: difference is 2x
> With SHM: difference is 4.5x
> With GPFS: difference is 10x
> 
> Is libgfortran doing something unusual with the creation of files?

So it looks like native is just doing one write system call while opposite
endian is doing 8k chunks write system calls.  This seems like an issue with
the file system if it cannot handle 8k chunks.

Maybe increasing the chunk size to 64k inside libgfortran will help.

Something like:
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index c2fc674..5d24ac4 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -193,7 +193,7 @@ fallback_access (const char *path, int mode)

 /* Unix and internal stream I/O module */

-static const int BUFFER_SIZE = 8192;
+static const int BUFFER_SIZE = 64*1024;

 typedef struct
 {

Reply via email to