https://llvm.org/bugs/show_bug.cgi?id=31153
Bug ID: 31153 Summary: unordered_set's operator= or insert() is slower without a reserve before it Product: libc++ Version: unspecified Hardware: PC OS: MacOS X Status: NEW Severity: normal Priority: P Component: All Bugs Assignee: unassignedclangb...@nondot.org Reporter: arpha...@gmail.com CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com Classification: Unclassified Created attachment 17643 --> https://llvm.org/bugs/attachment.cgi?id=17643&action=edit A sample file that reproduces this problem The use of unordered_set's "operator =" or call to "insert" is faster if you call "reserve" first (using the size of the copied or inserted set). I get about 10 - 15% improvements with "reserve". I've attached a sample file that can be used to reproduce this problem. I've tested it using "clang++ unordered_set_reserve.cpp -O3 -stdlib=libc++ -std=c++11" with ToT clang (r287852) and libcxx (r287829) on macOS (2015 MacBook Pro with 2.8 GHz Quad Core i7). -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs