From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21806 invoked by alias); 8 Aug 2011 11:52:04 -0000 Received: (qmail 21797 invoked by uid 22791); 8 Aug 2011 11:52:03 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Aug 2011 11:51:38 +0000 From: "jb at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libfortran/50016] The fortran program 's io is very slow X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libfortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jb at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 08 Aug 2011 11:52:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-08/txt/msg00848.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50016 Janne Blomqvist changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jb at gcc dot gnu.org --- Comment #6 from Janne Blomqvist 2011-08-08 11:51:34 UTC --- Maybe this is MingW specific? I haven't tested this, but here goes my guess: Since in the write loop we're jumping back and forth across the file, the buffer must be frequently flushed; in libgfortran/io/unix.c (buf_flush) we have in the trunk and 4.6 branch: #ifdef _WIN32 _commit (s->fd); #endif If this is some kind of win32 equivalent to fsync(), i.e. commit stuff to disk, then it's no surprise it's slow? This code was added to buf_flush() as a response to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44698 .