[libcxx-commits] [PATCH] D132505: [libc++] Refactor deque::iterator algorithm optimizations

Eric Fiselier via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Oct 2 12:24:47 PDT 2022


EricWF requested changes to this revision.
EricWF added inline comments.
This revision now requires changes to proceed.


================
Comment at: libcxx/benchmarks/deque_iterator.bench.cpp:124
+  auto operator()(Args... args) const {
+    std::move(std::forward<Args>(args)...);
+  }
----------------
Can you meaningfully do this more than once on the same container?


================
Comment at: libcxx/benchmarks/deque_iterator.bench.cpp:138
+  auto operator()(Args... args) const {
+    std::move_backward(std::forward<Args>(args)...);
+  }
----------------
Can you meaningfully do this more than once on the same container?


================
Comment at: libcxx/benchmarks/deque_iterator.bench.cpp:1
+//===----------------------------------------------------------------------===//
+//
----------------
philnik wrote:
> ldionne wrote:
> > I would be curious to try adding `_LIBCPP_ALWAYS_INLINE` to `__unwrap_and_dispatch` (and possibly other implementation details in that code path) to see what impact it has on the benchmarks. Could you try that out and report? I would assume that for raw pointers, that should all end up being inlined away.
> I've changed the implementation of `copy` and `move` to use the segment iterators and that fixed the performance issues, so I didn't test with `_LIBCPP_ALWAYS_INLINE`. 
Have you verified the assembly for these benchmarks?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132505/new/

https://reviews.llvm.org/D132505



More information about the libcxx-commits mailing list