[libcxx-commits] [libcxx] [libc++] Rewrite the std::make_heap benchmark (PR #178696)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 3 06:46:33 PST 2026


================
@@ -1,38 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// 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 "common.h"
-
-namespace {
-template <class ValueType>
-struct RangesPopHeap {
-  size_t Quantity;
-
-  void run(benchmark::State& state) const {
-    runOpOnCopies<ValueType>(state, Quantity, Order(), BatchSize::CountElements, [](auto& Copy) {
-      for (auto B = Copy.begin(), I = Copy.end(); I != B; --I) {
-        std::ranges::pop_heap(B, I);
----------------
philnik777 wrote:

We already have `pop_heap.bench.cpp` which is basically identical to this. I plan to refactor those benchmarks once this patch lands. I wanted to do this one first, since it's by far the most impact. I actually don't think refactoring the `{push,pop}_heap` benchmarks will make much of a difference time-wise.

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


More information about the libcxx-commits mailing list