This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/57885] unordered_map find slower in 4.8.1 than 4.7.3 with integer key
- From: "jhand at austin dot rr.com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 15 Jul 2013 22:38:41 +0000
- Subject: [Bug libstdc++/57885] unordered_map find slower in 4.8.1 than 4.7.3 with integer key
- Auto-submitted: auto-generated
- References: <bug-57885-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57885
--- Comment #4 from Jim Hand <jhand at austin dot rr.com> ---
I compiled 4.9.0-20130714 today and ran the same tests. Here are the results
for the lookup loops with the times for each compiler:
4.6.3: 11536 microseconds
4.7.3: 12150 microseconds (5.3% slower than 4.6.3)
4.8.2: 14810 microseconds (28.3% slower than 4.6.3)
4.9.0-20130714 15365 microseconds (33.1% slower than 4.6.3)
I took a look at the assembly for the "return a.find(5) != a.end();" code for
4.9 and it looks very similar to the 4.8 assembly, but contains two extra
instructions at the beginning of the function:
testq %r8, %r8
je .L8
I guess those two instructions explain the the slightly worse behavior for
4.9.0 than 4.8.2.