From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5467 invoked by alias); 26 Jan 2005 15:37:47 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 5220 invoked by uid 48); 26 Jan 2005 15:37:33 -0000 Date: Wed, 26 Jan 2005 15:37:00 -0000 Message-ID: <20050126153733.5219.qmail@sourceware.org> From: "pcarlini at suse dot de" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050126142651.19642.joerg.richter@pdv-fs.de> References: <20050126142651.19642.joerg.richter@pdv-fs.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libstdc++/19642] streaming doubles is very slow compared to sprintf X-Bugzilla-Reason: CC X-SW-Source: 2005-01/txt/msg03871.txt.bz2 List-Id: ------- Additional Comments From pcarlini at suse dot de 2005-01-26 15:37 ------- For reference, on linux, a typical profile (count = 10000000) begins as follows, and: 1- The various snprintf are on top. 2- uselocale (the thread safe equivalent of setlocale) is way below Therefore, we can easily guess that the performance are not so different from those of snprintf alone. Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls ms/call ms/call name 28.65 5.71 5.71 __printf_fp 13.50 8.40 2.69 __mpn_divrem 7.28 9.85 1.45 memcpy 6.62 11.17 1.32 buffered_vfprintf 5.67 12.30 1.13 vfprintf 5.22 13.34 1.04 __mpn_mul_1 2.51 13.84 0.50 mempcpy 2.31 14.30 0.46 std::ostream::operator<<(double) 2.21 14.74 0.44 __mpn_rshift 2.01 15.14 0.40 std::ostreambuf_iterator > std::num_put > >::_M_insert_float(std::ostreambuf_iterator >, std::ios_base&, char, char, double) const 2.01 15.54 0.40 isinf 1.81 15.90 0.36 isnan 1.46 16.19 0.29 std::basic_filebuf >::xsputn(char const*, int) 1.30 16.45 0.26 __mpn_extract_double 1.30 16.71 0.26 uselocale -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19642