[all-commits] [llvm/llvm-project] 0621fd: [libcxx] Optimize `rng::generate_n` for segmented ...

Connector Switch via All-commits all-commits at lists.llvm.org
Tue Oct 28 07:22:48 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0621fd0b8837192612d21785ad60664516513cea
      https://github.com/llvm/llvm-project/commit/0621fd0b8837192612d21785ad60664516513cea
  Author: Connector Switch <c8ef at outlook.com>
  Date:   2025-10-28 (Tue, 28 Oct 2025)

  Changed paths:
    M libcxx/docs/ReleaseNotes/22.rst
    M libcxx/include/__algorithm/generate_n.h
    M libcxx/include/__algorithm/ranges_generate_n.h

  Log Message:
  -----------
  [libcxx] Optimize `rng::generate_n` for segmented iterators (#165280)

Part of #102817.

This patch optimizes `rng::generate_n` for segmented iterators by
forwarding the implementation directly to `std::generate_n`.

- before

```
rng::generate_n(deque<int>)/32          21.7 ns         22.0 ns     32000000
rng::generate_n(deque<int>)/50          30.8 ns         30.7 ns     22400000
rng::generate_n(deque<int>)/1024         492 ns          488 ns      1120000
rng::generate_n(deque<int>)/8192        3938 ns         3924 ns       179200
```

- after

```
rng::generate_n(deque<int>)/32          11.0 ns         11.0 ns     64000000
rng::generate_n(deque<int>)/50          16.2 ns         16.1 ns     40727273
rng::generate_n(deque<int>)/1024         292 ns          286 ns      2240000
rng::generate_n(deque<int>)/8192        2291 ns         2302 ns       298667
```



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list