google-benchmark
A library to benchmark code snippets.
Decision gist · record as of 2026-08-14
Yes, if you need rigorous performance measurement. The library is actively maintained, has no runtime dependencies, and Apache-2.0 licensing poses no restrictions. Medium install friction is acceptable for a compiled package with broad platform support. Best suited for developers who want statistical benchmarking beyond simple timing—if you only need quick profiling, lighter tools may suffice.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; precompiled wheels available for macOS (x86_64, arm64), Linux (x86_64, aarch64), and Windows (amd64).
- Medium install friction due to compiled wheels for multiple platforms and Python versions (3.10–3.13).
- Active maintenance with recent releases; no runtime dependencies simplifies deployment once installed.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license allows use in proprietary and open-source projects with minimal restrictions; attribution required.
last release 2026-02-02 (193 days) · last repo commit 2026-08-12 · 10,351 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 75,335 downloads/mo, #14,726 on PyPI
Alternatives
Verify before relying
pip install google-benchmark
import benchmark
@benchmark.register
def BM_example(state):
for _ in state:
# Code to measure
pass- Exact API surface and decorator/function signatures for Python bindings beyond the C++ example shown
- Whether the package includes statistical analysis features (e.g., confidence intervals, regression detection) mentioned in the C++ docs
- Performance overhead of the Python binding layer compared to native C++ benchmarking
What it is and what it does
google-benchmark is a Python wrapper around Google's C++ benchmarking library, designed to measure and compare the performance of code snippets with statistical rigor. Unlike simple timing, it runs code multiple times under controlled conditions to produce reliable performance metrics. The library is modeled after unit-testing frameworks, so if you've used pytest or similar tools, the structure will feel familiar.
You define benchmark functions, register them with decorators or macros, and run them to get detailed timing statistics. It has no runtime dependencies beyond Python itself, making it lightweight to deploy. The package supports Python 3.10 through 3.13 and is actively maintained; precompiled wheels are available for common platforms (macOS, Linux, Windows across x86_64 and ARM architectures).
Use it for
- Measure and compare performance of different algorithm implementations to choose the fastest one
- Track performance regressions in CI/CD pipelines by benchmarking code before and after changes
- Profile hot paths in Python applications to identify optimization targets
- Generate reproducible performance reports for code review and documentation
- Validate that optimizations actually improve performance with statistical confidence
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need rigorous performance measurement.
The library is actively maintained, has no runtime dependencies, and Apache-2.0 licensing poses no restrictions. Medium install friction is acceptable for a compiled package with broad platform support. Best suited for developers who want statistical benchmarking beyond simple timing—if you only need quick profiling, lighter tools may suffice.
Install
google-benchmark on PyPI
Before you install
Medium install friction due to compiled wheels for multiple platforms and Python versions (3.10–3.13). Active maintenance with recent releases; no runtime dependencies simplifies deployment once installed.
Requires Python 3.10 or later; precompiled wheels available for macOS (x86_64, arm64), Linux (x86_64, aarch64), and Windows (amd64).
License in practice
Apache-2.0 permissive license allows use in proprietary and open-source projects with minimal restrictions; attribution required.
Quickstart
pip install google-benchmark
import benchmark
@benchmark.register
def BM_example(state):
for _ in state:
# Code to measure
pass
Verify before relying
- Exact API surface and decorator/function signatures for Python bindings beyond the C++ example shown
- Whether the package includes statistical analysis features (e.g., confidence intervals, regression detection) mentioned in the C++ docs
- Performance overhead of the Python binding layer compared to native C++ benchmarking
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 193 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 75,335 / month, #14,726 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Software Development :: TestingTopic :: System :: Benchmark |
Evidence: google_benchmark-1.9.5-cp310-cp310-macosx_10_14_x86_64.whl; google_benchmark-1.9.5-cp310-cp310-macosx_11_0_arm64.whl; google_benchmark-1.9.5-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; google_benchmark-1.9.5-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; google_benchmark-1.9.5-cp310-cp310-win_amd64.whl; google_benchmark-1.9.5-cp311-cp311-macosx_10_14_x86_64.whl; google_benchmark-1.9.5-cp311-cp311-macosx_11_0_arm64.whl; google_benchmark-1.9.5-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; google_benchmark-1.9.5-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; google_benchmark-1.9.5-cp311-cp311-win_amd64.whl; google_benchmark-1.9.5-cp312-abi3-macosx_10_14_x86_64.whl; google_benchmark-1.9.5-cp312-abi3-macosx_11_0_arm64.whl; google_benchmark-1.9.5-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; google_benchmark-1.9.5-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; google_benchmark-1.9.5-cp312-abi3-win_amd64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “statistical benchmarks”
- google-benchmarkProvides Python bindings to Google's C++ benchmarking library,…
- nemo-evaluatorNeMo Evaluator runs standardized benchmarks against language models…
- pyperfpyperf is a toolkit for writing, running, and analyzing Python…
Give your agent the search over MCP, or paste the wish link into any chat.
More System packages
Provides a platform-independent file locking mechanism to coordinate access to files across processes and threads.
Distro provides a reliable, machine-readable API to query the Linux or BSD distribution name, version, codename, and other OS platform details, replacing Python's deprecated `platform.linux_distribution` function.
Install it if you need to detect or report the Linux/BSD distribution your code runs on.
psutil retrieves real-time information about running processes and system resources (CPU, memory, disks, network, sensors) across multiple operating systems, enabling system monitoring, process profiling, and resource management.
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
Provides asynchronous file I/O operations for asyncio programs, with automatic selection of the best available backend (io_uring, libaio, thread-based, or pure Python) depending on your system.
Portalocker provides cross-platform file locking with support for exclusive and shared locks, plus Redis-based distributed locks and process-aware PID file locking.
Install it if you need file or process coordination; the optional extras (pywin32, redis) are only required for specific lock types.
See also whylogs-sketching · pytest-benchmark · pyperf · msbench-utils · codeflash-benchmark · pytest-cmake · pytest-codspeed · asv · asv-runner · libkvikio-cu12