[libcxx-commits] [libcxx] [libc++] Add benchmarks for std::is_heap and std::is_heap_until (PR #207045)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 9 03:15:59 PDT 2026


================
@@ -0,0 +1,83 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+
+#include <algorithm>
+#include <cstddef>
+#include <deque>
+#include <iterator>
+#include <string>
+#include <vector>
+
+#include "benchmark/benchmark.h"
+#include "../../GenerateInput.h"
+
+int main(int argc, char** argv) {
+  auto std_is_heap      = [](auto first, auto last) { return std::is_heap(first, last); };
+  auto std_is_heap_pred = [](auto first, auto last) {
+    return std::is_heap(first, last, [](auto x, auto y) {
+      benchmark::DoNotOptimize(x);
+      benchmark::DoNotOptimize(y);
+      return x < y;
----------------
philnik777 wrote:

Opened #208412.

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


More information about the libcxx-commits mailing list