[libcxx-commits] [libcxx] [libcxx] Added segment iterator for fill (PR #104680)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Aug 24 00:14:31 PDT 2024


================
@@ -21,23 +21,64 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 // fill isn't specialized for std::memset, because the compiler already optimizes the loop to a call to std::memset.
 
-template <class _ForwardIterator, class _Tp>
+template <
----------------
NoumanAmir657 wrote:

```
Benchmark               Old                     New

bm_deque_fill/1                   2.33             3.75 ns
bm_deque_fill/2                   2.82             4.01 ns
bm_deque_fill/3                   3.26             4.01 ns
bm_deque_fill/4                   3.60             3.34 ns
bm_deque_fill/5                   3.92             3.64 ns
bm_deque_fill/6                   4.48             3.64 ns
bm_deque_fill/7                   4.83             3.79 ns
bm_deque_fill/8                   5.46             3.28 ns
bm_deque_fill/16                 9.44             3.25 ns
bm_deque_fill/64                 33.3             3.14 ns
bm_deque_fill/512               200              7.20 ns
bm_deque_fill/4096             2041            39.7 ns
bm_deque_fill/32768           16345          288 ns
bm_deque_fill/262144         130562        2340 ns
bm_deque_fill/1048576       522694        12346 ns
```

https://github.com/llvm/llvm-project/pull/104680


More information about the libcxx-commits mailing list