This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/45574] cin.getline() is extremely slow
- From: "tstarling at wikimedia dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Sep 2010 00:17:14 -0000
- Subject: [Bug libstdc++/45574] cin.getline() is extremely slow
- References: <bug-45574-19663@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #23 from tstarling at wikimedia dot org 2010-09-10 00:17 -------
(In reply to comment #21)
> Anyway, not sure which STL getline we are talking about here, because e.g.
> src/istream.cc getline seems to access the stdio buffer directly:
> streamsize __size = std::min(streamsize(__sb->egptr()
> - __sb->gptr()),
> streamsize(__n - _M_gcount
> - 1));
__sb->gptr() and __sb->egptr() are always null for this kind of streambuf, so
__size is always zero, and so the loop just calls snextc() on every iteration.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45574