Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 84263 invoked from network); 21 Jun 2006 01:38:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Jun 2006 01:38:55 -0000 Received: (qmail 16741 invoked by uid 500); 21 Jun 2006 01:38:54 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 16727 invoked by uid 500); 21 Jun 2006 01:38:54 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 16716 invoked by uid 99); 21 Jun 2006 01:38:54 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jun 2006 18:38:54 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jun 2006 18:38:53 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2CF61410005 for ; Wed, 21 Jun 2006 01:37:30 +0000 (GMT) Message-ID: <15773360.1150853850166.JavaMail.jira@brutus> Date: Wed, 21 Jun 2006 01:37:30 +0000 (GMT+00:00) From: "Martin Sebor (JIRA)" To: stdcxx-dev@incubator.apache.org Subject: [jira] Assigned: (STDCXX-7) std::operator<<(ostream&, const char*) inefficient for unbuffered file I/O In-Reply-To: <384252751.1122498078323.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/STDCXX-7?page=all ] Martin Sebor reassigned STDCXX-7: --------------------------------- Assign To: Martin Sebor > std::operator<<(ostream&, const char*) inefficient for unbuffered file I/O > -------------------------------------------------------------------------- > > Key: STDCXX-7 > URL: http://issues.apache.org/jira/browse/STDCXX-7 > Project: C++ Standard Library > Type: Bug > Components: 27. Input/Output > Versions: 4.1.2 > Environment: All. > Reporter: Martin Sebor > Assignee: Martin Sebor > Fix For: 4.2 > > operator<<(ostream&, const char*) is inefficient when the stream argument is an unbuffered fstream object: it causes a call to write() for each character (ditto for the wide character versions). This affects all platforms. Here's a test case with HP aCC: > $ cat t.cpp && nice gmake SRCS=t.cpp && truss -o truss.out ./t && grep write truss.out > #include > int main () > { > std::ofstream f ("/dev/tty"); > f.rdbuf ()->pubsetbuf (0, 0); > f << "abcdef\n"; > } > aCC -c -I/build/sebor/dev/stdlib/include/ansi -I/usr/include -D_RWSTDDEBUG -mt -D_RWSTD_USE_CONFIG -I/build/sebor/aCC-3.63-15s/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include -Aa +nostl -g +d +w +W392 +W655 +W684 +W818 +W819 +W849 t.cpp > aCC t.o -o t -Aa +nostl -Wl,+s -Wl,+vnocompatwarnings -L/build/sebor/aCC-3.63-15s/lib -mt -L/build/sebor/aCC-3.63-15s/lib -lstd15s -lm > abcdef > write(4, "a ", 1) = 1 > write(4, "b ", 1) = 1 > write(4, "c ", 1) = 1 > write(4, "d ", 1) = 1 > write(4, "e ", 1) = 1 > write(4, "f ", 1) = 1 > write(4, "\n", 1) = 1 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira