Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 7124 invoked from network); 28 Jul 2005 00:07:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Jul 2005 00:07:48 -0000 Received: (qmail 11708 invoked by uid 500); 28 Jul 2005 00:07:48 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 11691 invoked by uid 500); 28 Jul 2005 00:07:48 -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 11678 invoked by uid 99); 28 Jul 2005 00:07:48 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Jul 2005 17:07:31 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 603B5E0 for ; Thu, 28 Jul 2005 02:07:19 +0200 (CEST) Message-ID: <889966173.1122509239392.JavaMail.jira@ajax.apache.org> Date: Thu, 28 Jul 2005 02:07:19 +0200 (CEST) From: "Martin Sebor (JIRA)" To: stdcxx-dev@incubator.apache.org Subject: [jira] Updated: (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 updated STDCXX-7: ------------------------------ Fix Version: 4.1.3 > std::operator<<(ostream&, const char*) inefficient for unbuffered file I/O > -------------------------------------------------------------------------- > > Key: STDCXX-7 > URL: http://issues.apache.org/jira/browse/STDCXX-7 > Project: STDCXX > Type: Bug > Components: 27. Input/Output > Versions: 4.1.2 > Environment: All. > Reporter: Martin Sebor > Fix For: 4.1.3 > > 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