https://llvm.org/bugs/show_bug.cgi?id=24643
Bug ID: 24643 Summary: FoldingSetNodeID::AddPointer is unnecessarily slow Product: libraries Version: trunk Hardware: PC OS: Windows NT Status: NEW Severity: normal Priority: P Component: Support Libraries Assignee: unassignedb...@nondot.org Reporter: ben.cr...@codeaurora.org CC: llvm-bugs@lists.llvm.org Classification: Unclassified FoldingSetNodeID houses the hash and equality material for FoldingSet's intrusive hash map data structure. The raw material is stored as a SmallVector<unsigned, 32>. The current implementation of AddPointer does a ranged append, like so... Bits.append(reinterpret_cast<unsigned *>(&Ptr), reinterpret_cast<unsigned *>(&Ptr+1)); This is done in order to support 32-bit and 64-bit pointers. Unfortunately, SmallVector::append with 1 element is slower than SmallVector::push_back with 1 element. Append with 2 elements is also slower than two push_backs. On MSVC, the append call eventually turns into a memmove + some bookkeeping. With push_back, it turns into a memcpy + some bookkeeping. When using the Clang static analyzer, AddPointer ends up being one of the top hits for exclusive / self time. -- 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