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++/20706] string::reserve severe performance regression


------- Additional Comments From pcarlini at suse dot de  2005-03-31 21:14 -------
I should also add, that, in general, your snippet could be simpler, without
penalizing the performance: typically reserve is only called once, at the 
outset, if we can estimate in advance the final size of the string. Otherwise,
internally, the implementation is *automatically* able to quickly grow the
capacity to satisfy efficiently a series of consecutive append: in our implement
the capacity automatically doubles every time is reached by the size of the 
growing string.

-- 


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


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