[libcxx-commits] [libcxx] [libc++] Introduce `__product_iterator_traits` and optimise `flat_map::insert` (PR #139454)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri May 16 10:46:30 PDT 2025
================
@@ -26,9 +27,54 @@ struct support::adapt_operations<std::flat_map<K, V>> {
static auto get_iterator(InsertionResult const& result) { return result.first; }
};
+void product_iterator_benchmark_flat_map(benchmark::State& state) {
----------------
ldionne wrote:
I would suggest looking at whether this can be moved to `libcxx/test/benchmarks/containers/associative/associative_container_benchmarks.h` and reused by other containers, flat or not. We might also want to drop the `sorted_unique` hint, since additional optimizations may be possible based on the knowledge that a sequence is sorted (and then this benchmark would show the difference without needed modifications).
https://github.com/llvm/llvm-project/pull/139454
More information about the libcxx-commits
mailing list