You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and observe the compile time with different preprocessor configurations (after prewarming the filesystem cache):
λ time g++-12 -std=c++20 -O2 -I/home/me/ldevel/vcpkg/installed/x64-linux/include compile-test.cpp -o compile-test
g++-12 -std=c++20 […] 0.01s user 0.02s system 99% cpu 0.033 total
λ time g++-12 -std=c++20 -I/home/me/ldevel/vcpkg/installed/x64-linux/include -O2 -DSTD_UNORDERED compile-test.cpp -o compile-test
g++-12 -std=c++20 […] 0.15s user 0.02s system 99% cpu 0.170 total
λ time g++-12 -std=c++20 -O2 -DBST_UNORDERED_FWD -I/home/me/ldevel/vcpkg/installed/x64-linux/include compile-test.cpp -o compile-test
g++-12 -std=c++20 […] 0.49s user 0.02s system 99% cpu 0.517 total
λ time g++-12 -std=c++20 -O2 -DBST_UNORDERED -I/home/me/ldevel/vcpkg/installed/x64-linux/include compile-test.cpp -o compile-test
g++-12 -std=c++20 […] 0.75s user 0.03s system 99% cpu 0.782 total
flags
time
0.033s
-DSTD_UNORDERED
0.170s
-DBST_UNORDERED_FWD
0.517s
-DBST_UNORDERED
0.782s
System information:
g++-12 (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0
CPU: Intel(R) Core(TM) i9-9980HK
The issue seems to be that unordered_flat_map always includes boost/container_hash/hash.hpp which in turn includes large parts of the standard library (<string>, <complex> => <sstream>, variant).
It seems somewhat unfortunate to me that the compile time is increased that much, especially since the unordered_flat_map is usually part of a composite data structure and therefore transitively included in many TUs.
Furthermore I usually don't use boost::hash but a custom hash implementation (SpookyHashv2, xxHash or domain specific hashes) and therefore would like to ask whether it'd be possible to provide a variant which either uses std::hash as default Hash parameter or doesn't supply one at all.
The text was updated successfully, but these errors were encountered:
I really like the implementation quality of this library. However, consider the following test program:
and observe the compile time with different preprocessor configurations (after prewarming the filesystem cache):
0.033s
-DSTD_UNORDERED
0.170s
-DBST_UNORDERED_FWD
0.517s
-DBST_UNORDERED
0.782s
System information:
The issue seems to be that
unordered_flat_map
always includesboost/container_hash/hash.hpp
which in turn includes large parts of the standard library (<string>
,<complex> => <sstream>
,variant
).It seems somewhat unfortunate to me that the compile time is increased that much, especially since the
unordered_flat_map
is usually part of a composite data structure and therefore transitively included in many TUs.Furthermore I usually don't use
boost::hash
but a custom hash implementation (SpookyHashv2, xxHash or domain specific hashes) and therefore would like to ask whether it'd be possible to provide a variant which either usesstd::hash
as defaultHash
parameter or doesn't supply one at all.The text was updated successfully, but these errors were encountered: