[libc++] Optimize std::for_each_n for segmented iterators (#135468)

This patch enhances the performance of `std::for_each_n` when used with
segmented iterators, leading to significant performance improvements,
summarized in the tables below. This addresses a subtask of
https://github.com/llvm/llvm-project/issues/102817.
This commit is contained in:
Peng Liu
2025-05-21 12:10:50 -04:00
committed by GitHub
parent 5a3776af52
commit 09c266b75d
8 changed files with 335 additions and 49 deletions

View File

@@ -437,6 +437,7 @@ module std [system] {
module find_segment_if { header "__algorithm/find_segment_if.h" }
module find { header "__algorithm/find.h" }
module for_each_n { header "__algorithm/for_each_n.h" }
module for_each_n_segment { header "__algorithm/for_each_n_segment.h" }
module for_each_segment { header "__algorithm/for_each_segment.h" }
module for_each { header "__algorithm/for_each.h" }
module generate_n { header "__algorithm/generate_n.h" }