Commit Graph

50 Commits

Author SHA1 Message Date
Dominic Hamon 192ef10025 version bump to 1.9.5
clang-format-lint / check-clang-format (push) Has been cancelled
clang-tidy / run-clang-tidy (push) Has been cancelled
sanitizer / asan.Debug (push) Has been cancelled
bazel / bazel.macos-latest (push) Has been cancelled
bazel / bazel.ubuntu-latest (push) Has been cancelled
bazel / bazel.windows-latest (push) Has been cancelled
sanitizer / msan.Debug (push) Has been cancelled
sanitizer / tsan.Debug (push) Has been cancelled
sanitizer / ubsan.Debug (push) Has been cancelled
sanitizer / asan.RelWithDebInfo (push) Has been cancelled
sanitizer / msan.RelWithDebInfo (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo (push) Has been cancelled
2026-01-21 13:16:48 +00:00
Jesse Rosenstock 90ebbdedf0 Make the Benchmark class public (#2101)
Move ::benchmark::internal::Benchmark to ::benchmark::Benchmark.

It's a bit odd that the documented way to pass arguments to a
benchmark is with `benchmark::internal::Benchmark`.  Make this
public instead.

https://github.com/google/benchmark/blob/v1.9.4/docs/user_guide.md#passing-arguments

https://raw.githubusercontent.com/google/benchmark/refs/tags/v1.9.4/docs/user_guide.md#:~:text=void%20CustomArguments(benchmark%3A%3A-,internal%3A%3ABenchmark,-*%20b)%20%7B%0A%20%20for%20(int

Keep ::benchmark::internal::Benchmark as a deprecated forwarding alias.
Uses of Benchmark in the internal namespace need to explicitly use
::benchmark::Benchmark to avoid the deprecation warning.
2026-01-14 21:04:17 +03:00
Nicholas Junge c2917683a1 bindings(python): Remove hard absl-py dependency (#2052)
* bindings(python): Remove hard `absl-py` dependency

This commit refactors the public `google_benchmark` APIs to work without
`absl-py` installed in the current virtual environment.
It also removes `absl-py` from the list of PyPI package dependencies.

To restore the previous behavior, users can implement a custom `main()` function using
`absl.app` as command-line parser + runner, for example as the previous default `main()`
function that is removed by this very commit.

* bindings(python): Remove private methods

They are no longer useful without absl. Instead, users can call the exposed C++
bindings (`_benchmark.Initialize()` and `_benchmark.RunSpecifiedBenchmarks`)
directly, all within a custom `main()` function.

---------

Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
2025-10-14 11:05:06 +01:00
Arseniy Terekhin 1d58aeb172 python: fix segfault on empty argv in main() (#2003)
Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
2025-08-13 08:41:03 +01:00
Arseniy Terekhin e629f99927 clang-format python bindings (benchmark.cc) (#2020) 2025-08-12 19:23:37 +03:00
Arseniy Terekhin 65aeed77f6 Python: add bindings for AddCustomContext (#1988)
* python: add bindings for `AddCustomContext`

* fix import order

---------

Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
2025-08-12 09:38:24 +01:00
Arseniy Terekhin 0d522831cf python binding: add range check (#1990)
fixes segmentation fault in ```import google_benchmark as benchmark
@benchmark.register
def av_test(state):
    state.range(9)
benchmark.main()
```
2025-05-21 09:21:35 +01:00
dominic hamon eddb024138 bump to v1.9.4
bazel / bazel.macos-latest (push) Has been cancelled
bazel / bazel.ubuntu-latest (push) Has been cancelled
bazel / bazel.windows-latest (push) Has been cancelled
clang-format-lint / check-clang-format (push) Has been cancelled
clang-tidy / run-clang-tidy (push) Has been cancelled
sanitizer / asan.Debug (push) Has been cancelled
sanitizer / msan.Debug (push) Has been cancelled
sanitizer / tsan.Debug (push) Has been cancelled
sanitizer / ubsan.Debug (push) Has been cancelled
sanitizer / asan.RelWithDebInfo (push) Has been cancelled
sanitizer / msan.RelWithDebInfo (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo (push) Has been cancelled
2025-05-19 16:45:45 +01:00
Dominic Hamon 299e592895 bump to v1.9.3 to prepare a release
bazel / bazel.ubuntu-latest (push) Has been cancelled
bazel / bazel.macos-latest (push) Has been cancelled
bazel / bazel.windows-latest (push) Has been cancelled
clang-format-lint / check-clang-format (push) Has been cancelled
clang-tidy / run-clang-tidy (push) Has been cancelled
sanitizer / asan.Debug (push) Has been cancelled
sanitizer / msan.Debug (push) Has been cancelled
sanitizer / tsan.Debug (push) Has been cancelled
sanitizer / ubsan.Debug (push) Has been cancelled
sanitizer / asan.RelWithDebInfo (push) Has been cancelled
sanitizer / msan.RelWithDebInfo (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo (push) Has been cancelled
2025-05-07 09:39:52 +01:00
Roman Lebedev f02794a8bd Automatic ASLR disablement (#1978)
While ASLR is a useful security hardening feature,
it introduces unreproducible noise into benchmarks,
and we really really really don't want any noise,
especially easily avoidable one.

Unless prevented by some other security hardening,
we can disable ASLR for the current process,
and restart it, thus eliminating this noise.

Fixes https://github.com/google/benchmark/issues/461
2025-05-01 17:34:09 +01:00
Dominic Hamon afa23b7699 bump version to 1.9.2 in readiness for release. #1957
bazel / bazel.windows-latest (push) Has been cancelled
bazel / bazel.ubuntu-latest (push) Has been cancelled
clang-format-lint / check-clang-format (push) Has been cancelled
bazel / bazel.macos-latest (push) Has been cancelled
clang-tidy / run-clang-tidy (push) Has been cancelled
sanitizer / asan.Debug (push) Has been cancelled
sanitizer / msan.Debug (push) Has been cancelled
sanitizer / tsan.Debug (push) Has been cancelled
sanitizer / ubsan.Debug (push) Has been cancelled
sanitizer / asan.RelWithDebInfo (push) Has been cancelled
sanitizer / msan.RelWithDebInfo (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo (push) Has been cancelled
2025-03-25 09:17:34 +00:00
Nicholas Junge 657a55a0d4 dx: Update pre-commit repos, change imports of Python / CC rules (#1937)
The changes are an autofix added in Buildifier 8.0.1, designed to future-proof
Bazel projects against the eventual removal of these rules from the native
Bazel namespace.
2025-02-17 13:28:32 +00:00
Christian Clauss 3d027d7e38 ruff rule E501: Fix long lines in Python code (#1910)
* ruff rule E501: Fix long lines in Python code

* Add missing space

---------

Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
2025-01-22 16:43:07 +00:00
Christian Clauss ecb5df6473 Lint Python: Add more ruff rules (#1909)
* Lint Python: Add more ruff rules

* range(len()) --> enumerate()

* zip(strict=True)
2025-01-22 11:50:00 +00:00
Dominic Hamon c58e6d0710 v1.9.1 bump
bazel / bazel.macos-latest.no_bzlmod (push) Has been cancelled
bazel / bazel.ubuntu-latest.no_bzlmod (push) Has been cancelled
bazel / bazel.windows-latest.no_bzlmod (push) Has been cancelled
bazel / bazel.macos-latest.bzlmod (push) Has been cancelled
bazel / bazel.ubuntu-latest.bzlmod (push) Has been cancelled
bazel / bazel.windows-latest.bzlmod (push) Has been cancelled
clang-format-lint / check-clang-format (push) Has been cancelled
clang-tidy / run-clang-tidy (push) Has been cancelled
sanitizer / asan.Debug (push) Has been cancelled
sanitizer / msan.Debug (push) Has been cancelled
sanitizer / tsan.Debug (push) Has been cancelled
sanitizer / ubsan.Debug (push) Has been cancelled
sanitizer / asan.RelWithDebInfo (push) Has been cancelled
sanitizer / msan.RelWithDebInfo (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo (push) Has been cancelled
2024-11-28 16:51:38 +00:00
Nicholas Junge d99cdd7356 Add nb::is_flag() annotation to Counter::Flags (#1870)
This saves us the definition of `__or__`, because we can just use the
one from `enum.IntFlag`.
2024-10-28 18:18:40 +00:00
Nicholas Junge 986423a62d Bump oldest supported Python to 3.10, eliminate setuptools-scm (#1842)
* 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.
2024-09-04 17:42:07 +01:00
Alex Bilger 437fea4b54 Fix Python manual timing example (#1722)
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>
2024-08-16 15:32:48 +01:00
Nicholas Junge 25e5c52a11 Bump nanobind-bazel to v2.1.0, add stubgen target (#1824)
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>
2024-07-30 15:49:33 +01:00
Peter Hawkins 64b5d8cd11 Update benchmark Python bindings for nanobind 2.0, and update to nanobind 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.
2024-07-18 16:54:02 +01:00
Nicholas Junge eaafe694d2 Add Python bindings build using bzlmod (#1764)
* Add a bzlmod Python bindings build

Uses the newly started `@nanobind_bazel` project to build nanobind
extensions. This means that we can drop all in-tree custom build defs
and build files for nanobind and the C++ Python headers.

Additionally, the temporary WORKSPACE overwrite hack naturally goes away
due to the WORKSPACE system being obsolete.

* Bump ruff -> v0.3.1, change ruff settings

The latest minor releases incurred some formatting and configuration
changes, this commit rolls them out.

---------

Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
2024-03-07 12:28:55 +00:00
Nicholas Junge 3623765dd3 Add setuptools_scm for dynamic zero-config Python versioning (#1690)
* Add `setuptools_scm` for dynamic zero-config Python versioning

This removes the need for manually bumping versions in the Python
bindings.

For the wheel uploads, the correct semver version is inferred in the case
of tagged commits, which is exactly the case in GitHub CI.

The docs were updated to reflect the changes in the release workflow.

* Add separate version variable and module, use PEP484-compliant exports

This is the best practice mentioned in the `setuptools_scm` docs, see
https://setuptools-scm.readthedocs.io/en/latest/usage/#version-at-runtime.
2023-11-01 09:48:01 +00:00
Nicholas Junge bce46fb413 Drop isort hook for ruff builtin import sorting (#1689)
This behaves the same, and saves a pre-commit step. ruff just needs an
additional package location hint to correctly map first-part packages
(in this case, `google_benchmark`).

This revealed a misformat in the `google_benchmark.__init__`, which is
now fixed.
2023-10-31 10:05:37 +00:00
Nicholas Junge b93f5a5929 Add pre-commit config and GitHub Actions job (#1688)
* Add pre-commit config and GitHub Actions job

Contains the following hooks:
* buildifier - for formatting and linting Bazel files.
* mypy, ruff, isort, black - for Python typechecking, import hygiene,
static analysis, and formatting.

The pylint CI job was changed to be a pre-commit CI job, where pre-commit
is bootstrapped via Python.

Pylint is currently no longer part of the
code checks, but can be re-added if requested. The reason to drop was
that it does not play nicely with pre-commit, and lots of its
functionality and responsibilities are actually covered in ruff.

* Add dev extra to pyproject.toml for development installs

* Clarify that pre-commit contains only Python and Bazel hooks

* Add one-line docstrings to Bazel modules

* Apply buildifier pre-commit fixes to Bazel files

* Apply pre-commit fixes to Python files

* Supply --profile=black to isort to prevent conflicts

* Fix nanobind build file formatting

* Add tooling configs to `pyproject.toml`

In particular, set line length 80 for all Python files.

* Reformat all Python files to line length 80, fix return type annotations

Also ignores the `tools/compare.py` and `tools/gbench/report.py` files
for mypy, since they emit a barrage of errors which we can deal with
later. The errors are mostly related to dynamic classmethod definition.
2023-10-30 15:35:37 +00:00
Dominic Hamon 344117638c bump version to 1.8.3
bazel / bazel.macos-latest.no_bzlmod (push) Has been cancelled
bazel / bazel.ubuntu-latest.no_bzlmod (push) Has been cancelled
bazel / bazel.windows-latest.no_bzlmod (push) Has been cancelled
bazel / bazel.macos-latest.bzlmod (push) Has been cancelled
bazel / bazel.ubuntu-latest.bzlmod (push) Has been cancelled
bazel / bazel.windows-latest.bzlmod (push) Has been cancelled
clang-format-lint / build (push) Has been cancelled
clang-tidy / run-clang-tidy (push) Has been cancelled
sanitizer / asan.Debug (push) Has been cancelled
sanitizer / msan.Debug (push) Has been cancelled
sanitizer / tsan.Debug (push) Has been cancelled
sanitizer / ubsan.Debug (push) Has been cancelled
sanitizer / asan.RelWithDebInfo (push) Has been cancelled
sanitizer / msan.RelWithDebInfo (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo (push) Has been cancelled
2023-08-31 13:16:50 +01:00
Dominic Hamon 015d1a091a bump version to 1.8.2 ready for release
bazel / bazel.macos-latest.no_bzlmod (push) Has been cancelled
bazel / bazel.ubuntu-latest.no_bzlmod (push) Has been cancelled
bazel / bazel.windows-2022.no_bzlmod (push) Has been cancelled
bazel / bazel.macos-latest.bzlmod (push) Has been cancelled
bazel / bazel.ubuntu-latest.bzlmod (push) Has been cancelled
bazel / bazel.windows-2022.bzlmod (push) Has been cancelled
clang-format-lint / build (push) Has been cancelled
clang-tidy / run-clang-tidy (push) Has been cancelled
sanitizer / asan.Debug (push) Has been cancelled
sanitizer / msan.Debug (push) Has been cancelled
sanitizer / tsan.Debug (push) Has been cancelled
sanitizer / ubsan.Debug (push) Has been cancelled
sanitizer / asan.RelWithDebInfo (push) Has been cancelled
sanitizer / msan.RelWithDebInfo (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo (push) Has been cancelled
2023-07-06 09:50:35 +01:00
Dominic Hamon daa12bcc5a bump version to 1.8.1 pre release
bazel / bazel.macos-latest.no_bzlmod (push) Has been cancelled
bazel / bazel.ubuntu-latest.no_bzlmod (push) Has been cancelled
bazel / bazel.windows-2022.no_bzlmod (push) Has been cancelled
bazel / bazel.macos-latest.bzlmod (push) Has been cancelled
bazel / bazel.ubuntu-latest.bzlmod (push) Has been cancelled
bazel / bazel.windows-2022.bzlmod (push) Has been cancelled
clang-format-lint / build (push) Has been cancelled
clang-tidy / run-clang-tidy (push) Has been cancelled
sanitizer / asan.Debug (push) Has been cancelled
sanitizer / msan.Debug (push) Has been cancelled
sanitizer / tsan.Debug (push) Has been cancelled
sanitizer / ubsan.Debug (push) Has been cancelled
sanitizer / asan.RelWithDebInfo (push) Has been cancelled
sanitizer / msan.RelWithDebInfo (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo (push) Has been cancelled
2023-07-04 08:48:07 +01:00
Dominic Hamon 2dd015dfef update version to v1.8.0
clang-format-lint / build (push) Has been cancelled
bazel / bazel.macos-latest (push) Has been cancelled
bazel / bazel.ubuntu-latest (push) Has been cancelled
bazel / bazel.windows-2022 (push) Has been cancelled
clang-tidy / run-clang-tidy (push) Has been cancelled
sanitizer / asan.Debug (push) Has been cancelled
sanitizer / msan.Debug (push) Has been cancelled
sanitizer / tsan.Debug (push) Has been cancelled
sanitizer / ubsan.Debug (push) Has been cancelled
sanitizer / asan.RelWithDebInfo (push) Has been cancelled
sanitizer / msan.RelWithDebInfo (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo (push) Has been cancelled
2023-05-05 11:25:54 +01:00
dominic 46d3c84518 Convert uses of const char* to std::string (#1567)
* Convert uses of const char* to std::string

* fix sanitizer builds

* reformat user guide

* include python bindings

* clang-format
2023-03-14 13:10:27 +00:00
Nicholas Junge 23dadfa4a7 Bump nanobind to stable v0.2.0, change linker options (#1565)
Bumps nanobind to v0.2.0, the latest stable version to include all
features needed to create the GBM bindings. Deprecated names in v0.2.0
were migrated to their new counterparts.

Linkopts for macOS were changed to mirror the "endorsed" linker options
used in nanobind's CMake config, which were changed since the last
commit.
2023-03-07 11:22:00 +00:00
Nicholas Junge 80a3c5e4d9 Switch bindings implementation to nanobind (#1526)
* End support for Python 3.7, update cibuildwheel and publish actions

Removes Python 3.7 from the support matrix, since it does not support
PEP590 vectorcalls.

Bumps the `cibuildwheel` and `pypa-publish` actions to their latest
available versions respectively.

* Add nanobind to the Bazel dependencies, add a BUILD file

The build file builds nanobind as a static `cc_library`. Currently,
the git SHA points to HEAD, since some necessary features have not
been included in a release yet.

* Delete pybind11 BUILD file

* Switch bindings implementation to nanobind

Switches over the binding tool to `nanobind` from `pybind11`. Most
changes in the build setup itself were drop-in replacements of existing
code changed to nanobind names, no new concepts needed to be
implemented.

Sets the minimum required macOS to 10.14 for full C++17 support. Also,
to avoid ambiguities in Bazel, build for macOS 11 on Mac ARM64.

* Use Bazel select for linker options

Guards against unknown linker option errors by selecting required
linker options for nanobind only on macOS, where they are relevant.

Other changes:
* Bump cibuildwheel action to v2.12.0
* Bump Bazel for aarch64 linux wheels to 6.0.0
* Remove C++17 flag from build files since it is present in setup.py `bazel build` command
* Bump nanobind commit to current HEAD (TBD: Bump to next stable release)

* Unbreak Windows builds of nanobind-based bindings

Guards compiler options behind a new `select` macro choosing between
MSVC and not MSVC.

Other changes:
* Inject the proper C++17 standard cxxopt in the `setup.py` build
command.
* Bump nanobind to current HEAD.
* Make `macos` a benchmark-wide condition, with public visibility to
allow its use in the nanobind BUILD file.

* Fall back to `nb::implicitly_convertible` for Counter construction

Since `benchmark::Counter` only has a constructor for `double`,
the nanobind `nb::init_implicit` template cannot be used. Therefore,
to support implicit construction from ints, we fall back to the
`nb::implicitly_convertible` template instead.
2023-02-06 13:07:17 +00:00
SunBlack fe65457e80 Fix typos found by codespell (#1519) 2023-01-10 12:25:32 +00:00
Dominic Hamon d572f47773 version bump for release
clang-format-lint / build (push) Has been cancelled
bazel / bazel.macos-latest (push) Has been cancelled
bazel / bazel.ubuntu-latest (push) Has been cancelled
bazel / bazel.windows-2022 (push) Has been cancelled
clang-tidy / run-clang-tidy (push) Has been cancelled
sanitizer / asan.Debug.clang (push) Has been cancelled
sanitizer / tsan.Debug.clang (push) Has been cancelled
sanitizer / ubsan.Debug.clang (push) Has been cancelled
sanitizer / asan.Debug.gcc (push) Has been cancelled
sanitizer / tsan.Debug.gcc (push) Has been cancelled
sanitizer / ubsan.Debug.gcc (push) Has been cancelled
sanitizer / asan.RelWithDebInfo.clang (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo.clang (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo.clang (push) Has been cancelled
sanitizer / asan.RelWithDebInfo.gcc (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo.gcc (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo.gcc (push) Has been cancelled
2022-11-11 14:01:03 +00:00
Dominic Hamon af32e3fe1a run ClearRegisteredBenchmarks at exit (#1463) 2022-08-08 21:34:20 +01:00
Dominic Hamon 361e8d1cfe version bump
build-and-test / ubuntu-latest.Release.static.clang++ (push) Has been cancelled
build-and-test / macos-latest.Release.shared.g++ (push) Has been cancelled
build-and-test / ubuntu-20.04.Release.shared.g++ (push) Has been cancelled
build-and-test / ubuntu-latest.Release.shared.g++ (push) Has been cancelled
build-and-test / macos-latest.Release.static.g++ (push) Has been cancelled
build-and-test / ubuntu-20.04.Release.static.g++ (push) Has been cancelled
build-and-test / ubuntu-latest.Release.static.g++ (push) Has been cancelled
build-and-test / macos-latest.Debug.shared.clang++ (push) Has been cancelled
bazel / bazel.windows-2022 (push) Has been cancelled
build-and-test / ubuntu-20.04.Debug.shared.clang++ (push) Has been cancelled
build-and-test / ubuntu-latest.Debug.shared.clang++ (push) Has been cancelled
build-and-test / macos-latest.Debug.static.clang++ (push) Has been cancelled
build-and-test / ubuntu-20.04.Debug.static.clang++ (push) Has been cancelled
build-and-test / ubuntu-latest.Debug.static.clang++ (push) Has been cancelled
build-and-test / macos-latest.Debug.shared.g++ (push) Has been cancelled
build-and-test / macos-latest.Debug.static.g++ (push) Has been cancelled
build-and-test / ubuntu-20.04.Debug.shared.g++ (push) Has been cancelled
build-and-test / ubuntu-latest.Debug.shared.g++ (push) Has been cancelled
build-and-test / ubuntu-20.04.Debug.static.g++ (push) Has been cancelled
build-and-test / ubuntu-latest.Debug.static.g++ (push) Has been cancelled
build-and-test / macos-latest.Release.shared.clang++ (push) Has been cancelled
build-and-test / ubuntu-20.04.Release.shared.clang++ (push) Has been cancelled
build-and-test / ubuntu-latest.Release.shared.clang++ (push) Has been cancelled
build-and-test / macos-latest.Release.static.clang++ (push) Has been cancelled
clang-format-lint / build (push) Has been cancelled
build-and-test / ubuntu-20.04.Release.static.clang++ (push) Has been cancelled
bazel / bazel.macos-latest (push) Has been cancelled
bazel / bazel.ubuntu-latest (push) Has been cancelled
build-and-test / windows-2019.Debug.shared.VS-16-2019 (push) Has been cancelled
build-and-test / windows-2019.Debug.static.VS-16-2019 (push) Has been cancelled
build-and-test / windows-2022.Debug.shared.VS-17-2022 (push) Has been cancelled
build-and-test / windows-2022.Debug.static.VS-17-2022 (push) Has been cancelled
build-and-test / ubuntu-16.04.Debug.g++ (push) Has been cancelled
build-and-test / windows-2019.Release.shared.VS-16-2019 (push) Has been cancelled
build-and-test / windows-2019.Release.static.VS-16-2019 (push) Has been cancelled
build-and-test / windows-2022.Release.shared.VS-17-2022 (push) Has been cancelled
build-and-test / windows-2022.Release.static.VS-17-2022 (push) Has been cancelled
build-and-test / ubuntu-16.04.Debug.clang++ (push) Has been cancelled
build-and-test / ubuntu-16.04.Release.clang++ (push) Has been cancelled
build-and-test / ubuntu-16.04.Release.g++ (push) Has been cancelled
build-and-test / ubuntu-14.04.Debug.clang++-3.6 (push) Has been cancelled
build-and-test / ubuntu-14.04.Debug.g++-4.8 (push) Has been cancelled
build-and-test / ubuntu-14.04.Debug.g++-6 (push) Has been cancelled
build-and-test / ubuntu-14.04.Release.clang++-3.6 (push) Has been cancelled
build-and-test / ubuntu-14.04.Release.g++-4.8 (push) Has been cancelled
build-and-test / ubuntu-14.04.Release.g++-6 (push) Has been cancelled
clang-tidy / run-clang-tidy (push) Has been cancelled
sanitizer / asan.Debug.clang (push) Has been cancelled
sanitizer / tsan.Debug.clang (push) Has been cancelled
sanitizer / ubsan.Debug.clang (push) Has been cancelled
sanitizer / asan.Debug.gcc (push) Has been cancelled
sanitizer / tsan.Debug.gcc (push) Has been cancelled
sanitizer / ubsan.Debug.gcc (push) Has been cancelled
sanitizer / asan.RelWithDebInfo.clang (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo.clang (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo.clang (push) Has been cancelled
sanitizer / asan.RelWithDebInfo.gcc (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo.gcc (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo.gcc (push) Has been cancelled
2022-07-25 12:35:38 +01:00
Dominic Hamon 7a2024e961 v1.6.2 bump 2022-07-18 15:34:24 +01:00
Ross McIlroy 48c2d1c1ee Expose google_benchmark.State for python bindings. (#1430)
Allows for type annotations.
2022-07-15 18:06:53 +01:00
Matthdonau 7eb8c0fe45 Introduce warmup phase to BenchmarkRunner (#1130) (#1399)
* Introduce warmup phase to BenchmarkRunner (#1130)

In order to account for caching effects in user
benchmarks introduce a new command line option
"--benchmark_min_warmup_time"
which allows to specify an amount of time for
which the benchmark should be run before results
are meaningful.

* Adapt review suggestions regarding introduction of warmup phase (#1130)

* Fix BM_CHECK call in MinWarmUpTime (#1130)

* Fix comment on requirements of MinWarmUpTime (#1130)

* Add basic description of warmup phase mechanism to user guide (#1130)
2022-05-23 13:50:17 +01:00
Sergiu Deitsch 9e47d070fe annotate and export public symbols (#1321) 2022-02-14 10:48:53 +00:00
Dominic Hamon 0d98dba29d Creating release commit for v1.6.1
bazel / build-and-test (push) Has been cancelled
build-and-test / ubuntu-14.04.Release.clang++-3.6 (push) Has been cancelled
build-and-test / ubuntu-14.04.Release.g++-4.8 (push) Has been cancelled
build-and-test / ubuntu-14.04.Release.g++-6 (push) Has been cancelled
clang-format-lint / build (push) Has been cancelled
sanitizer / asan.Debug.clang (push) Has been cancelled
build-and-test / macos-latest.Debug.clang++ (push) Has been cancelled
build-and-test / ubuntu-20.04.Debug.clang++ (push) Has been cancelled
build-and-test / ubuntu-latest.Debug.clang++ (push) Has been cancelled
build-and-test / macos-latest.Debug.g++ (push) Has been cancelled
build-and-test / ubuntu-20.04.Debug.g++ (push) Has been cancelled
build-and-test / ubuntu-latest.Debug.g++ (push) Has been cancelled
build-and-test / windows-latest.Debug. (push) Has been cancelled
build-and-test / macos-latest.Release.clang++ (push) Has been cancelled
build-and-test / ubuntu-20.04.Release.clang++ (push) Has been cancelled
build-and-test / ubuntu-latest.Release.clang++ (push) Has been cancelled
build-and-test / macos-latest.Release.g++ (push) Has been cancelled
build-and-test / ubuntu-20.04.Release.g++ (push) Has been cancelled
build-and-test / ubuntu-latest.Release.g++ (push) Has been cancelled
build-and-test / windows-latest.Release. (push) Has been cancelled
build-and-test / ubuntu-16.04.Debug.clang++ (push) Has been cancelled
build-and-test / ubuntu-16.04.Debug.g++ (push) Has been cancelled
build-and-test / ubuntu-16.04.Release.clang++ (push) Has been cancelled
build-and-test / ubuntu-16.04.Release.g++ (push) Has been cancelled
build-and-test / ubuntu-14.04.Debug.clang++-3.6 (push) Has been cancelled
build-and-test / ubuntu-14.04.Debug.g++-4.8 (push) Has been cancelled
build-and-test / ubuntu-14.04.Debug.g++-6 (push) Has been cancelled
clang-tidy / run-clang-tidy (push) Has been cancelled
sanitizer / tsan.Debug.clang (push) Has been cancelled
sanitizer / ubsan.Debug.clang (push) Has been cancelled
sanitizer / asan.Debug.gcc (push) Has been cancelled
sanitizer / tsan.Debug.gcc (push) Has been cancelled
sanitizer / ubsan.Debug.gcc (push) Has been cancelled
sanitizer / asan.RelWithDebInfo.clang (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo.clang (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo.clang (push) Has been cancelled
sanitizer / asan.RelWithDebInfo.gcc (push) Has been cancelled
sanitizer / tsan.RelWithDebInfo.gcc (push) Has been cancelled
sanitizer / ubsan.RelWithDebInfo.gcc (push) Has been cancelled
2022-01-10 19:14:27 +00:00
Vy Nguyen dc1a97174d Introduce accessors for currently public data members (threads and thread_index) (#1208)
* [benchmark] Introduce accessors for currently public data members `threads` and `thread_index`

Also deprecate the direct access to these fields.

Motivations:

Our internal library provides accessors for those fields because the styleguide disalows accessing classes' data members directly (even if they're const).
There has been a discussion to simply move internal library to make its fields public similarly to the OSS version here, however, the concern is that these kinds of direct access would prevent many types of future design changes (eg how/whether the values would be stored in the data member)

I think the concensus in the end is that we'd change the external library for this case.
AFAIK, there are three important third_party users that we'd need to migrate: tcmalloc, abseil and tensorflow.
Please let me know if I'm missing anyone else.

* [benchmark] Introduce accessors for currently public data members `threads` and `thread_index`

Also deprecate the direct access to these fields.

Motivations:

Our internal library provides accessors for those fields because the styleguide disalows accessing classes' data members directly (even if they're const).
There has been a discussion to simply move internal library to make its fields public similarly to the OSS version here, however, the concern is that these kinds of direct access would prevent many types of future design changes (eg how/whether the values would be stored in the data member)

I think the concensus in the end is that we'd change the external library for this case.
AFAIK, there are three important third_party users that we'd need to migrate: tcmalloc, abseil and tensorflow.
Please let me know if I'm missing anyone else.

* [benchmark] Introduce accessors for currently public data members `threads` and `thread_index`

Also deprecate direct access to `.thread_index` and make threads a private field

Motivations:

Our internal library provides accessors for those fields because the styleguide disalows accessing classes' data members directly (even if they're const).
There has been a discussion to simply move internal library to make its fields public similarly to the OSS version here, however, the concern is that these kinds of direct access would prevent many types of future design changes (eg how/whether the values would be stored in the data member)

I think the concensus in the end is that we'd change the external library for this case.
AFAIK, there are three important third_party users that we'd need to migrate: tcmalloc, abseil and tensorflow.
Please let me know if I'm missing anyone else.

* [benchmark] Introduce accessors for currently public data members `threads` and `thread_index`

Also deprecate direct access to `.thread_index` and make threads a private field

Motivations:

Our internal library provides accessors for those fields because the styleguide disalows accessing classes' data members directly (even if they're const).
There has been a discussion to simply move internal library to make its fields public similarly to the OSS version here, however, the concern is that these kinds of direct access would prevent many types of future design changes (eg how/whether the values would be stored in the data member)

I think the concensus in the end is that we'd change the external library for this case.
AFAIK, there are three important third_party users that we'd need to migrate: tcmalloc, abseil and tensorflow.
Please let me know if I'm missing anyone else.

* [benchmark] Introduce accessors for currently public data members `threads` and `thread_index`

Also deprecate direct access to `.thread_index` and make threads a private field

Motivations:

Our internal library provides accessors for those fields because the styleguide disalows accessing classes' data members directly (even if they're const).
There has been a discussion to simply move internal library to make its fields public similarly to the OSS version here, however, the concern is that these kinds of direct access would prevent many types of future design changes (eg how/whether the values would be stored in the data member)

I think the concensus in the end is that we'd change the external library for this case.
AFAIK, there are three important third_party users that we'd need to migrate: tcmalloc, abseil and tensorflow.
Please let me know if I'm missing anyone else.

* [benchmark] Introduce accessors for currently public data members `threads` and `thread_index`

Also deprecate direct access to `.thread_index` and make threads a private field

Motivations:

Our internal library provides accessors for those fields because the styleguide disalows accessing classes' data members directly (even if they're const).
There has been a discussion to simply move internal library to make its fields public similarly to the OSS version here, however, the concern is that these kinds of direct access would prevent many types of future design changes (eg how/whether the values would be stored in the data member)

I think the concensus in the end is that we'd change the external library for this case.
AFAIK, there are three important third_party users that we'd need to migrate: tcmalloc, abseil and tensorflow.
Please let me know if I'm missing anyone else.

* [benchmark] Introduce accessors for currently public data members `threads` and `thread_index`

Also deprecate direct access to `.thread_index` and make threads a private field

Motivations:

Our internal library provides accessors for those fields because the styleguide disalows accessing classes' data members directly (even if they're const).
There has been a discussion to simply move internal library to make its fields public similarly to the OSS version here, however, the concern is that these kinds of direct access would prevent many types of future design changes (eg how/whether the values would be stored in the data member)

I think the concensus in the end is that we'd change the external library for this case.
AFAIK, there are three important third_party users that we'd need to migrate: tcmalloc, abseil and tensorflow.
Please let me know if I'm missing anyone else.

* [benchmark] Introduce accessors for currently public data members `threads` and `thread_index`

Also deprecate direct access to `.thread_index` and make threads a private field

Motivations:

Our internal library provides accessors for those fields because the styleguide disalows accessing classes' data members directly (even if they're const).
There has been a discussion to simply move internal library to make its fields public similarly to the OSS version here, however, the concern is that these kinds of direct access would prevent many types of future design changes (eg how/whether the values would be stored in the data member)

I think the concensus in the end is that we'd change the external library for this case.
AFAIK, there are three important third_party users that we'd need to migrate: tcmalloc, abseil and tensorflow.
Please let me know if I'm missing anyone else.

* [benchmark] Introduce accessors for currently public data members `threads` and `thread_index`

Also deprecate direct access to `.thread_index` and make threads a private field

Motivations:

Our internal library provides accessors for those fields because the styleguide disalows accessing classes' data members directly (even if they're const).
There has been a discussion to simply move internal library to make its fields public similarly to the OSS version here, however, the concern is that these kinds of direct access would prevent many types of future design changes (eg how/whether the values would be stored in the data member)

I think the concensus in the end is that we'd change the external library for this case.
AFAIK, there are three important third_party users that we'd need to migrate: tcmalloc, abseil and tensorflow.
Please let me know if I'm missing anyone else.

* [benchmark] Introduce accessors for currently public data members `threads` and `thread_index`

Also deprecate direct access to `.thread_index` and make threads a private field

Motivations:

Our internal library provides accessors for those fields because the styleguide disalows accessing classes' data members directly (even if they're const).
There has been a discussion to simply move internal library to make its fields public similarly to the OSS version here, however, the concern is that these kinds of direct access would prevent many types of future design changes (eg how/whether the values would be stored in the data member)

I think the concensus in the end is that we'd change the external library for this case.
AFAIK, there are three important third_party users that we'd need to migrate: tcmalloc, abseil and tensorflow.
Please let me know if I'm missing anyone else.
2021-08-23 09:06:57 +01:00
Mircea Trofin d6778aebbe Deduplicate test function name in python bindings example (#1189)
This appears to be the source of unclean termination of the test on some
versions of python related to object dereferencing.
2021-06-28 10:28:04 +01:00
Dominic Hamon f1deaf16b8 fix minor typo (though this is an external property) 2021-04-09 13:00:43 +01:00
Dominic Hamon 5a77a6d8dc fix minor typo 2021-04-09 13:00:06 +01:00
feserr 378ed8ff25 Add 'seconds' time unit (#1076)
Fixes #1075.

* Add an option to report in seconds.

* Reduce the time of the test.

* Add CSV/JSON tests for new time reports.
2020-12-21 20:15:58 +03:00
Antoine Prouvost 73d4d5e8d6 Bind benchmark builder to Python (#1040)
* Fix setup.py and reformat

* Bind benchmark

* Add benchmark option to Python

* Add Python examples for range, complexity, and thread

* Remove invalid multithreading in Python

* Bump Python bindings version to 0.2.0

Co-authored-by: Dominic Hamon <dominichamon@users.noreply.github.com>
2020-09-11 10:55:18 +01:00
Antoine Prouvost 12e85b2eeb Bind more State methods/attributes to Python (#1037)
* Bind Counter to Python

* Bind State methods to Python

* Bind state.counters to Python

* Import _benchmark.Counter

* Add Python example of state usage

Co-authored-by: Dominic Hamon <dominichamon@users.noreply.github.com>
2020-09-10 09:57:30 +01:00
Dominic Hamon beb360d03e Create pylint.yml (#1039)
* Create pylint.yml

* improve file matching

* fix some pylint issues

* run on PR and push (force on master only)

* more pylint fixes

* suppress noisy exit code and filter to fatals

* add conan as a dep so the module is importable

* fix lint error on unreachable branch
2020-09-09 09:43:26 +01:00
Chris Jones 37177a84b7 Fix python extension import (#1000) 2020-07-09 12:54:41 +01:00
Chris Jones 39c8d58a76 Rename python bindings package to google_benchmark. (#999)
A few people have complained that `benchmark` is too generic. Also, add
Python 3.8.
2020-07-09 09:23:06 +01:00