public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Benjamin Kosnik <bkoz@redhat.com>
To: jason@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: libstdc++/4150: catastrophic performance decrease in C++ code
Date: Wed, 17 Apr 2002 21:56:00 -0000	[thread overview]
Message-ID: <20020418045601.14179.qmail@sources.redhat.com> (raw)

The following reply was made to PR libstdc++/4150; it has been noted by GNATS.

From: Benjamin Kosnik <bkoz@redhat.com>
To: Jason Merrill <jason@redhat.com>
Cc: libstdc++@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/4150: catastrophic performance decrease in C++ code
Date: Wed, 17 Apr 2002 21:46:14 -0700

 First of all, thanks. I was hoping somebody else would touch this code.
 
 > A problem with the current implementation of this is that if we do a
 > read on an input/output filebuf, we end up writing the contents of the
 > buffer back out to the file, even if we've never requested a write. 
 > Oops.
 
 Hmmm.
 
 Please write a testcase that demonstrates this, and add it to
 27_io/filebuf_members.cc
 
 I know that file is kind of long and unwieldy at this point.
 
 I'm trying to have the testsuite actually work and prevent lossage.... I
 know it's more work for you, but it'll be less work in the long run for
 all concerned if all regressions are in the testsuite.
 
 > In v3, this problem is handled, basically, by contaminating streambuf
 > with information about filebuf semantics.  We need the streambuf
 > member functions to adjust _M_out_cur with _M_in_cur, so we add a flag
 > (_M_buf_unified) that says so, and handle the logic in the
 > _M_*_cur_move functions.  Similarly, for the benefit of stringbuf, we
 > pretend that we can just bump _M_out_end if we run up against it and
 > we happen to know that there's still room in the buffer.
 > 
 > It seems unfortunate to me that we need special hacks in streambuf to
 > support both of the standard derived streambufs.  Both seem to be for
 > optimization; the filebuf hack to allow reading and writing on the
 > same buffer, and the stringbuf hack to avoid having to call overflow()
 > through the vtable for each character we want to add to the end of the
 > string.  Am I right?
 
 Right. The design is actually for stringbufs.
 
 > logauswerter.C times:
 >           synced   not synced
 > 2.96       0:19       0:19
 > pre-patch  1:09       0:14
 > post-patch 0:26       0:13
 > 
 > Interesting that v3 is faster than v2 when not synced with stdio...
 
 Yeah. I noticed this with bench++ as well. There was some commentary on
 this a bit ago, but I cannot place it.
 
 The thing that sucks are the narrow/wide stream objects and
 sync_with_stdio. 
 
 > I feel like I know my way around streambufs a lot better now.
 
 Great. So, how do you like debugging C++ with the current tools?
 Painful, huh? Does it make you feel psychic when you fix things?
 
 ;)
 
 Please let me know if you have any special kung-fu to pass on.
 
 > Tested i686-pc-linux-gnu, no regressions.  Any objections?
 
 Mainline and branch have diverged a bit right now. Did you test with
 branch or mainline?
 
 I need to get solaris back in shape on mainline: bsd's, hpux, aix,
 cygwin are all back in shape now, but solaris is still kind of dicy. I'm
 going to ask you to hold off, at least on the branch, till I have the
 libstdc++/4164 patch integrated. Also, you'll need to do the testsuite
 entry before you can check in. Okay?
 
 Does this mean that the FSEEK hacks in config/os/*/bits/os_defines.h can
 be removed, since this define is no longer used?
 
 -benjamin


             reply	other threads:[~2002-04-18  4:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-17 21:56 Benjamin Kosnik [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-04-23  5:23 jason
2002-04-18  4:06 Jason Merrill
2002-04-18  3:06 Jason Merrill
2002-04-17 19:26 Jason Merrill
2002-04-16  5:46 Jason Merrill
2002-04-15 16:16 Jason Merrill
2002-04-15  7:42 jason
2002-04-14 19:36 Jason Merrill
2002-04-14 11:13 jason
2002-04-11 18:20 ljrittle
2002-04-11 17:19 rth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020418045601.14179.qmail@sources.redhat.com \
    --to=bkoz@redhat.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=jason@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).