https://bugs.llvm.org/show_bug.cgi?id=49324
Bug ID: 49324
Summary: The performance of some vector operator is worse than
GCC
Product: libc++
Version: 8.0
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: 499537...@qq.com
CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com
Created attachment 24563
--> https://bugs.llvm.org/attachment.cgi?id=24563&action=edit
testcase
clang++ -O2 test.cpp
./a,out
g++ -O2 test.cpp
./a.out
clang++ -v
clang version 8.0.1 (based on LLVM 8.0.1)
g++ -v
gcc version 7.3.0
result for example:
test clangxxO2/gxxO2
test_int8_t[data5(data.begin(), data.end())] 13.03
test_int8_t[data1.assign(100000000, 100)] 9.58
test_int8_t[data7.assign(data.begin(), data.end())] 18.81
We have other operator worse than GCC, like map and unordered_set.
For vector assign, the main function consumed is __construct_range_forward.
libcxx use the __construct_range_forward
Each element is constructed using the construct method, which is constructed
using the placement new method. GCC uses std::uninitialized_copy to copy the
memory. The performance is significantly better than that of libcxx.
see: https://bugs.llvm.org/show_bug.cgi?id=48893#add_comment
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs