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++/54393] std::getline is almost 10x slower when working on a vstring versus std::string


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

--- Comment #3 from Adhemerval Zanella <azanella at linux dot vnet.ibm.com> 2012-08-28 18:49:42 UTC ---
The default algorithm used on both std::string and __gnu_cxx::__vstring appends
data char by char. However, std::string also provides an template
specialization for both char and wchar_t (defined in src/istream.cc) which
appends the data from the stream using larger buffer (which is calculated by
finding the delimiter).

Based on that and following how std::string provides its template
specialization, I'm proposing a fix for the performance issue. This was made
against gcc-4.6 (I still working a patch for trunk) and I only update the
baseline_symbols for PPC64 (since it a still RFC patch).


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