public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/4470: Thousands of seeks per read from cin
@ 2002-05-17  3:12 bkoz
  0 siblings, 0 replies; 5+ messages in thread
From: bkoz @ 2002-05-17  3:12 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, kw+gnats, nobody

Synopsis: Thousands of seeks per read from cin

State-Changed-From-To: analyzed->feedback
State-Changed-By: bkoz
State-Changed-When: Fri May 17 03:12:53 2002
State-Changed-Why:
    This should have been fixed with patches to gcc-3.1. Please confirm.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4470


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: libstdc++/4470: Thousands of seeks per read from cin
@ 2002-05-27  2:33 bkoz
  0 siblings, 0 replies; 5+ messages in thread
From: bkoz @ 2002-05-27  2:33 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, kw+gnats, nobody

Synopsis: Thousands of seeks per read from cin

State-Changed-From-To: feedback->closed
State-Changed-By: bkoz
State-Changed-When: Mon May 27 02:32:00 2002
State-Changed-Why:
    Jason actually fixed this.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4470


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: libstdc++/4470: Thousands of seeks per read from cin
@ 2002-05-21 15:16 Kevin Watkins
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Watkins @ 2002-05-21 15:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Kevin Watkins <kw+@cs.cmu.edu>
To: bkoz@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, 
    kw+gnats@cs.cmu.edu, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: libstdc++/4470: Thousands of seeks per read from cin
Date: 21 May 2002 18:13:28 -0400

 The seek system calls appear to have been eliminated using gcc-3.1 on
 i686-pc-linux-gnu (redhat 7.1, built from source).
 
 I should note that the workaround suggested in the bug
 
    std::ios_base::sync_with_stdio(false);
 
 didn't actually work for me under gcc-3.0.1 (the thousands of seek
 system calls were still being generated).
 
 Kevin
 
 On Fri, 2002-05-17 at 06:12, bkoz@gcc.gnu.org wrote:
 > Synopsis: Thousands of seeks per read from cin
 > 
 > State-Changed-From-To: analyzed->feedback
 > State-Changed-By: bkoz
 > State-Changed-When: Fri May 17 03:12:53 2002
 > State-Changed-Why:
 >     This should have been fixed with patches to gcc-3.1. Please confirm.
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4470
 > 
 
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: libstdc++/4470: Thousands of seeks per read from cin
@ 2001-10-04 15:49 ljrittle
  0 siblings, 0 replies; 5+ messages in thread
From: ljrittle @ 2001-10-04 15:49 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, kw+gnats, nobody

Synopsis: Thousands of seeks per read from cin

State-Changed-From-To: open->analyzed
State-Changed-By: ljrittle
State-Changed-When: Thu Oct  4 15:49:44 2001
State-Changed-Why:
    You have hit a known issue.  There are two things
    you can try:
    
    Add _GLIBCPP_AVOID_FSEEK to the os_defines.h file for your
    port.  That will remove all useless seeking for your example
    (at least it does on my platform).
    
    Add a line of code to your example at the head of main:
    
    std::ios_base::sync_with_stdio (false);
    
    Until libio is directly supported again, performance on
    Linux may be (much) worse for some code examples compared
    to libstdc++-v2.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4470&database=gcc


^ permalink raw reply	[flat|nested] 5+ messages in thread

* libstdc++/4470: Thousands of seeks per read from cin
@ 2001-10-04 12:56 kw+gnats
  0 siblings, 0 replies; 5+ messages in thread
From: kw+gnats @ 2001-10-04 12:56 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4470
>Category:       libstdc++
>Synopsis:       Thousands of seeks per read from cin
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 04 12:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Kevin Watkins
>Release:        gcc version 3.0.1
>Organization:
>Environment:
RedHat 7.1 (Linux 2.4.10 i686)
gcc was built from source with ./configure && make && make install
>Description:
The following code:

  #include <iostream>
  int main() {
    char buf[1024];
    while (std::cin.read(buf, 1024));
  }

when compiled thus:

  g++ -static qwe.cc

and run thus:

  ./a.out < /usr/dict/words

generates thousands of seek system calls per read system
call, as revealed by strace.  This is an insurmountable
performance problem.
The problem is specific to cin; it has not been observed
for files opened via the ifstream constructor.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-05-27  9:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-17  3:12 libstdc++/4470: Thousands of seeks per read from cin bkoz
  -- strict thread matches above, loose matches on Subject: below --
2002-05-27  2:33 bkoz
2002-05-21 15:16 Kevin Watkins
2001-10-04 15:49 ljrittle
2001-10-04 12:56 kw+gnats

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).