Skip to content

feat: add time based benchmarks#1749

Open
chandra-siri wants to merge 14 commits intomainfrom
time_based_benchmarks
Open

feat: add time based benchmarks#1749
chandra-siri wants to merge 14 commits intomainfrom
time_based_benchmarks

Conversation

@chandra-siri
Copy link
Collaborator

feat: add time based benchmarks

@product-auto-label product-auto-label bot added size: l Pull request size is large. api: storage Issues related to the googleapis/python-storage API. labels Feb 10, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @chandra-siri, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes a foundational framework for time-based performance microbenchmarks within the project. The primary goal is to enable more accurate and continuous measurement of Google Cloud Storage read throughput under various conditions, moving beyond operation-count-based benchmarks to duration-based evaluations. This enhancement will provide deeper insights into the system's sustained performance characteristics.

Highlights

  • New Time-Based Benchmarking Framework: Introduced a new set of microbenchmarks designed to measure performance over a specified duration, including a warmup period, for Google Cloud Storage read operations.
  • Configurable Benchmark Parameters: Implemented a flexible configuration system using YAML to define various benchmark parameters such as bucket types, file sizes, chunk sizes, duration, and workload patterns (sequential and random reads).
  • Multi-Process and Asynchronous Read Operations: Developed a pytest-based test suite that leverages multiprocessing and asyncio to simulate concurrent read operations, allowing for realistic performance evaluation under various concurrency levels.
  • CPU Affinity for Worker Processes: Configured worker processes to set CPU affinity, pinning them to specific cores to potentially reduce context switching overhead and improve benchmark consistency.
Changelog
  • tests/perf/microbenchmarks/time_based/conftest.py
    • Added a pytest fixture to provide workload parameters and dynamically generated filenames for time-based benchmarks.
  • tests/perf/microbenchmarks/time_based/reads/config.py
    • Added a module to parse YAML configuration and generate a comprehensive list of benchmark parameters for time-based read operations.
  • tests/perf/microbenchmarks/time_based/reads/config.yaml
    • Added a YAML configuration file defining common and workload-specific parameters for time-based sequential and random read benchmarks.
  • tests/perf/microbenchmarks/time_based/reads/parameters.py
    • Added a dataclass to encapsulate parameters specific to time-based read benchmarks, including pattern, duration, and warmup duration.
  • tests/perf/microbenchmarks/time_based/reads/test_reads.py
    • Added the main pytest file implementing time-based microbenchmarks for Google Cloud Storage read operations, featuring multi-process, asynchronous execution, and throughput calculation.
Activity
  • No human activity (comments, reviews, etc.) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces time-based benchmarks for read operations. The changes include new configuration files (yaml and .py), a conftest.py for test setup, and the benchmark test logic itself. The implementation uses multiprocessing to run downloads in parallel.

My review focuses on improving the maintainability, portability, and performance of the benchmark code. Key suggestions include removing commented-out code, making benchmark names more descriptive, avoiding hardcoded values for CPU affinity to improve portability, and optimizing the download loop to reduce memory allocations and redundant calls, which is crucial for accurate performance measurement.

@chandra-siri chandra-siri marked this pull request as ready for review February 13, 2026 07:34
@chandra-siri chandra-siri requested review from a team as code owners February 13, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the googleapis/python-storage API. size: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants