This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/23956] Class __mt_alloc overexerts __policy_type::_S_get_pool
- From: "guillaume dot melquiond at ens-lyon dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Sep 2005 05:07:56 -0000
- Subject: [Bug libstdc++/23956] Class __mt_alloc overexerts __policy_type::_S_get_pool
- References: <20050918190242.23956.guillaume.melquiond@ens-lyon.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From guillaume dot melquiond at ens-lyon dot fr 2005-09-20 05:07 -------
Created an attachment (id=9779)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9779&action=view)
Remove gratuitous calls to _S_get_pool in __mt_alloc
Since I didn't find any reason for these calls, I removed them (see attached
patch) and ran a few tests. The following testcase has been compiled at -O3
-march=pentium3.
#include <list>
int main() {
for(int j = 0; j < 10000000; ++j) {
std::list<int> a, b, c;
std::list<double> d, e, f;
std::list<char> g, h, i;
}
}
Without the calls, the list creation is 70% faster: 2.2s instead of 3.7s on my
computer. When adding an element into each list at each iteration, there still
is a 15% speedup: 15.4s instead of 17.8s. So the cost of these calls to
_S_get_pool is not negligible. And the other STL containers are affected as
well, not just std::list.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23956