This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/45574] cin.getline() is extremely slow



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]