aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Bump oldest supported Python to 3.10, eliminate setuptools-scm (#1842)HEADmainNicholas Junge2024-09-04
| | | | | | | | | | | | | | | | | | | | | * Supply MacOS deployment target to delocate, use build+uv frontend This shaves off multiple minutes from the wheel builds alone. Also revert to trusted publishing for wheel uploads as it is now set up. * Bump oldest supported Python to 3.10, eliminate setuptools-scm The version is now a string again, under the same attribute as it was before. This is a pragmatic decision in order to be able to upload wheels again, possibly directly from main. We could in the future also set the Python version to a development version if we want to avoid accidental uploads of `main`. * Add a note on supported Python versions in the docs Also fixes the setuptools failure observed in the latest CI by pinning to the last version before v73 until the problem is identified and resolved.
* Fix C4459: Rename a function parameter `profiler_manager` to avoid hiding ↵Igor Zhukov2024-08-19
| | | | | | | | | | the global declaration. (#1839) * Fix C4459: Rename a function parameter `profiler_manager` to avoid hiding the global declaration. * Treat warnings as errors for MSVC * disable one warning for MSVC
* Align benchmark::State to a cacheline. (#1230)Chris Kennelly2024-08-16
| | | | | | | | | | | | | | | * Align benchmark::State to a cacheline. This can avoid interference with neighboring objects and stabilize benchmark results. * separate cachline definition from alignment attribute macro Co-authored-by: Roman Lebedev <lebedev.ri@gmail.com> --------- Co-authored-by: dominic <510002+dmah42@users.noreply.github.com> Co-authored-by: Roman Lebedev <lebedev.ri@gmail.com>
* Fix Python manual timing example (#1722)Alex Bilger2024-08-16
| | | | | | | According to the user guide, when manual timing, it is necessary to explicit it by using the `UseManualTime` function. Its equivalent in Python is use_manual_time(). This function was not called in the example. It is possible to verify that the use of this function has an impact on the measure by adding another `time.sleep(0.01)` at the end of the iteration. There is a x2 difference depending on whether `use_manual_time()` is used or not. Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
* separate wheel versions in an effort to avoid timeoutsDominic Hamon2024-08-16
|
* v1.9.0v1.9.0Dominic Hamon2024-08-16
|
* Ensure reported Time is walltime by removing spurious scaling by threads (#1836)dominic2024-08-13
| | | | * change the default to not scale
* chore: update perf_counters.cc (#1831)Ikko Eltociear Ashimine2024-08-05
| | | peformance -> performance
* Update clang-format-lint-action (#1829)mosfet802024-08-02
| | | | | Colorize output in github action Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
* Cache upd (#1830)mosfet802024-08-02
| | | | | | | | | * Update bazel.yml switch to node20 updated actions/cache to v4 * Update pre-commit.yml switch to node20 updated actions/cache to v4
* Move ProfilerManager Start/Stop routines closer to actual benchmark #1807 ↵xdje422024-08-01
| | | | | | | | | | | (#1818) Previously, the Start/Stop routines were called before the benchmark function was called and after it returned. However, what we really want is for them to be called within the core of the benchmark: for (auto _ : state) { // This is what we want traced, not the entire BM_foo function. }
* Bump nanobind-bazel to v2.1.0, add stubgen target (#1824)Nicholas Junge2024-07-30
| | | | | | | | | | | Adds a stub file for the `google_benchmark._benchmark` submodule, generated with the new `nanobind_stubgen` rule released in nanobind_bazel v2.1.0. Tweaks the setup.py logic a little bit to package stub files with the rest of the build artifacts. Also explicitly adds the generated stub and marker files to the list of package data artifacts. Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
* Update nanobind into benchmark_deps.bzl (#1826)mosfet802024-07-30
| | | | | * Update nanobind into benchmark_deps.bzl * Update benchmark_deps.bzl
* Update libs into .pre-commit-config.yaml (#1825)mosfet802024-07-30
|
* Use log2 now that NDK requires at least API 21 which includes it. (#1822)dominic2024-07-24
| | | Fixes #1820
* Suppress invalid-offsetof warning for clang (#1821)Devon Loehr2024-07-24
| | | For several compilers, `benchmark.cc` suppresses a warning regarding its use of `offsetof`. This merely extends that suppression to cover clang as well.
* Revert to token authentication for PyPI wheel uploads (#1819)Nicholas Junge2024-07-23
| | | | | | | | | | | Until the PyPI account is recovered, it should be possible to upload wheels with the GitHub secrets that were previously used. Changes the PyPI upload action sourcing to point to the v1 stable release branch, which receives rolling updates and is the canonical way of including the wheel publishing action. Uploading will probably need another release, because setuptools_scm needs to produce a clean tag that the PyPI API allows as an upload.
* Update benchmark Python bindings for nanobind 2.0, and update to nanobind ↵Peter Hawkins2024-07-18
| | | | | | | | | | | | | | | | | 2.0. (#1817) Incorporates the nanobind_bazel change from https://github.com/google/benchmark/pull/1795. nanobind 2.0 reworked the nanobind::enum_ class so it uses a real Python enum or intenum rather than its previous hand-rolled implementation. https://nanobind.readthedocs.io/en/latest/changelog.html#version-2-0-0-may-23-2024 As a consequence of that change, nanobind now checks when casting an integer to a enum value that the integer corresponds to a valid enum. Counter::Flags is a bitmask, and many combinations are not valid enum members. This change: a) sets nb::is_arithmetic(), which means Counter::Flags becomes an IntEnum that can be freely cast to an integer. b) defines the | operator for flags to return an integer, not an enum, avoiding the error. c) changes Counter's constructor to accept an int, not a Counter::Flags enum. Since Counter::Flags is an IntEnum now, it can be freely coerced to an int. If https://github.com/wjakob/nanobind/pull/599 is merged into nanobind, then we can perhaps use a flag enum here instead.
* preparing for v1.8.5v1.8.5Dominic Hamon2024-07-18
|
* clang format yet againDominic Hamon2024-07-17
|
* update actions/checkout to v4Dominic Hamon2024-07-17
|
* another reversal of something that breaks on wasmDominic Hamon2024-07-17
|
* clang format header fixesDominic Hamon2024-07-17
|
* clang-format fixesDominic Hamon2024-07-17
|
* roll back fatal error that breaks some platform (wasm) expectationsDominic Hamon2024-07-17
|
* revert perf counters change until we can do the full versionDominic Hamon2024-07-16
|
* remove old travis configDominic Hamon2024-07-16
|
* [FR] Add API to provide custom profilers #1807 (#1809)xdje422024-07-16
| | | | | | | | This API is akin to the MemoryManager API and lets tools provide their own profiler which is wrapped in the same way MemoryManager is wrapped. Namely, the profiler provides Start/Stop methods that are called at the start/end of running the benchmark in a separate pass. Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
* Clarify the difference between `BENCHMARK_TEMPLATE_F` and ↵Jiawen (Kevin) Chen2024-07-16
| | | | | | | | | | | `BENCHMARK_TEMPLATE_DEFINE_F` + `BENCHMARK_REGISTER_F` (#1815) * Clarify BENCHMARK_REGISTER_F Add comments highlighting the difference between `BENCHMARK_TEMPLATE_F` and `BENCHMARK_TEMPLATE_DEFINE_F`, mirroring those of `BENCHMARK_F ` and `BENCHMARK_DEFINE_F`. * More informative comments. * Update user_guide.md
* add PERF_FORMAT_TOTAL_TIME_{ENABLED,RUNNING} to support multiplexing (#1814)dominic2024-07-12
|
* Add -lkstat to the .pc for Solaris (#1801)Chris Cotter2024-07-03
| | | | | | | | | | | | | | | | * Add -lkstat to the .pc for Solaris This fixes linking for projects that rely on pkg-config to generate the link line on Solaris. Test plan: Built the project locally on Solaris and verified -kstat appears in the .pc file ``` $ cat lib/pkgconfig/benchmark.pc | grep Libs.private Libs.private: -lpthread -lkstat ``` * Use BENCHMARK_PRIVATE_LINK_LIBRARIES
* Find libpfm dependency in installed CMake configs (#1806)Stephen Nicholas Swatman2024-06-19
| | | | | | | | | | Currently, Google Benchmark can be built and installed with support for libpfm, but this can cause a problem if that installation is later called upon by another CMake project. Indeed, while the installed CMake configuration script correctly identifies that it needs to link against libpfm, it doesn't try to find libpfm, meaning that the target will be unavailable. This commit fixes this potential configuration-time error by ensuring that an installation of Google Benchmark will correctly try to find the libpfm dependency when it is used elsewhere.
* [bazel] Use `includes` instead of `strip_include_prefix` (#1803)Alexander Karatarakis2024-06-17
| | | | | | | | | | | | | | When using `includes`, consumers will apply the headers using `-isystem`, instead of `-I`. This will allow diagnostics of consumers to not apply to `benchmark`. More info: https://bazel.build/reference/be/c-cpp#cc_library.includes https://bazel.build/reference/be/c-cpp#cc_library.strip_include_prefix gtest uses `includes` as well: https://github.com/google/googletest/blob/1d17ea141d2c11b8917d2c7d029f1c4e2b9769b2/BUILD.bazel#L120
* cycleclock: Fix type conversion to match function return type on riscv64 (#1802)Khem Raj2024-06-11
| | | | | | | | Fixes builds with clang src/cycleclock.h:213:10: error: implicit conversion changes signedness: 'uint64_t' (aka 'unsigned long') to 'int64_t' (aka 'long') [-Werror,-Wsign-conversion] 213 | return cycles; | ~~~~~~ ^~~~~~ 1 error generated.
* Bump minimum required C++ version from C++11 to C++14 (#1800)Robert Schulze2024-06-10
|
* bump standard to C++14 (#1799)dominic2024-06-07
| | | | | * update requirements to point to our dependencies doc * bump standard to c++14
* cycleclock: Fix type conversion to match function return type (#1794)Khem Raj2024-05-29
| | | | | | | | fixes build with clang19 src/cycleclock.h:208:52: error: implicit conversion changes signedness: 'uint64_t' (aka 'unsigned long long') to 'int64_t' (aka 'long long') [-Werror,-Wsign-conversion] 208 | return (static_cast<uint64_t>(cycles_hi1) << 32) | cycles_lo; | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ 1 error generated.
* CMake: unbreak version handling for tarballs (#1793)Roman Lebedev2024-05-28
| | | | | | | | #1742 changed the placeholder version from `0.0.0` to `v0.0.0`, but this line which was further dealing with it, was not updated. Fixes https://github.com/google/benchmark/issues/1792 Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
* hotfix: Correct pypi-publishing action tag to v1.8.14 (#1791)Nicholas Junge2024-05-24
| | | Also bump pre-commit dependencies via `pre-commit autoupdate`.
* Improve compatibility with Hexagon hardware (#1785)Steven Johnson2024-05-23
| | | | The customization done via BENCHMARK_OS_QURT works just fine with the Hexagon simulator, but on at least some Hexagon hardware, both `qurt_timer_get_ticks()` and `std::chrono::now()` are broken and always return 0. This fixes the former by using the better-supported (and essentially identical `qurt_sysclock_get_hw_ticks()` call, and the latter by reading a 19.2MHz hardware counter (per suggestion from Qualcomm). Local testing seems to indicate these changes are just as robust under the simulator as before.
* preparing for v1.8.4 (#1788)v1.8.4dominic2024-05-23
|
* Modernize wheel building job config (#1783)Nicholas Junge2024-04-15
| | | | | | | | | | | | | | | | | | | | It is now possible to build Mac wheels on native machines in Github Actions, so ARM64 Mac wheels are now built and tested on M1 machines. Also, the artifact up-/download was migrated to v4, which made it necessary to upload wheels to unique artifact names, and then later stitch them together again in a subsequent job. The cross-platform Mac build injection in setup.py was removed, since it is no longer necessary. I relanded a monkey-patching of Bazel build files, this time for MODULE.bazel. This is because `rules_python` does not allow running as the root user, which is the case in cibuildwheel+Linux (happens in a Docker container). Since I did not see a quick way of switching to rootless containers, and did not want to hardcode the config change (it can apparently cause cache misses and build failures), I inject the "ignore_root_user_error" flag into the MODULE.bazel file when running in cibuildwheel on Linux.
* Switch git override to stable BCR tag for nanobind_bazel (#1778)Nicholas Junge2024-04-15
| | | | | | | | | This comes following the first BCR release of nanobind_bazel. Feature-wise, nothing substantial has changed, except that the extensions are stripped of debug info when built in release mode, which reduces clutter in the symbol tables. No stubgen yet, since nanobind v2 has not been released yet.
* Add `benchmark_main.pc` to link `main()` containing library (#1779)David Seifert2024-04-14
| | | | | This is similar to the addition in https://github.com/google/googletest/commit/8604c4adac40573f806cfadae44e22f8dfaf212a#diff-eb8e49bdf5e9aafb996777a4f4302ad1efd281222bf3202eb9b77ce47496c345 that added pkg-config support in GTest. Without this, users need to manually find the library containing `main()`.
* Refactor: Return frequency as double (#1782)dhairya2024-04-13
| | | | | Adjusted the GetSysctl call in sysinfo.cc to ensure the frequency value is returned as a double rather than an integer. This helps maintain consistency and clarity in the codebase.
* Remove COMPILER_IBMXL macro for z/OS (#1777)Fanbo Meng2024-04-03
| | | COMPILER_IBMXL identifies the Clang based IBM XL compiler (xlclang) on z/OS. This compiler is obsolete and replaced by the Open XL compiler, so the macro is no longer needed and the existing code would lead to incorrect asm syntax for Open XL.
* Fix OpenBSD build (#1772)Vasyl Zubko2024-03-24
|
* allow BENCHMARK_VERSION to be undefined (#1769)PhilipDeegan2024-03-21
|
* clang-tidy broke the world (#1766)Roman Lebedev2024-03-18
| | | | `AnalyzeTemporaryDtors` option is no longer recognized by clang-tidy-18, and that renders the whole config invalid and completely ignored... ???
* Fix implicit conversion changes signess warning in perf_counters.cc (#1765)Afanasyev Ivan2024-03-09
| | | | `read_bytes` is `ssize_t` (and we know it's non-negative), we need to explicitly cast it to `size_t`.