This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/20706] string::reserve severe performance regression
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 Mar 2005 21:14:13 -0000
- Subject: [Bug libstdc++/20706] string::reserve severe performance regression
- References: <20050331202728.20706.ftr@highstreetnetworks.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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