I don't know exactly how much (2x?), but certainly can be faster and should just
exploit a "bulky" algorithm very similar to what we have for istream::getline
and getline(istream, string) - for char and wchar_t - see istream.cc. An 
annoying
complication in this case is the use of ctype::is, which, at present at least, 
cannot be as fast as traits::find: that's why I cannot exactly estimate the 
margin
of improvement, but it's worth a try and certainly long term it's the way to go 
even if at the moment ctype::is turns out to be a performance bottleneck.

-- 
           Summary: operator>>(istream, string/CharT*) can be faster
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pcarlini at suse dot de
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22515

Reply via email to