Skip to content

Conversation

@chandra-siri
Copy link
Collaborator

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: storage Issues related to the googleapis/python-storage API. labels Jan 19, 2026
@chandra-siri chandra-siri changed the base branch from main to bench January 19, 2026 13:04
@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 robust microbenchmarking suite for Google Cloud Storage read operations. It provides the necessary infrastructure to define, execute, and analyze performance tests under various conditions, including different concurrency models and read access patterns. The framework is designed to be highly configurable and includes tools for detailed resource utilization monitoring and streamlined result reporting, which will be instrumental in identifying performance bottlenecks and optimizing read throughput.

Highlights

  • New Microbenchmarking Framework: Introduced a comprehensive microbenchmarking framework for Google Cloud Storage read operations, enabling detailed performance analysis.
  • Flexible Read Workloads: The framework supports various read patterns, including single-process/single-coroutine, single-process/multi-coroutine, and multi-process/multi-coroutine scenarios for both sequential and random data access, with a specific focus on benchmarking read ranges.
  • Resource Monitoring and Reporting: Added a ResourceMonitor to track CPU, memory, and network usage during benchmarks, and a utility script (json_to_csv.py) to convert pytest-benchmark JSON output into an easily analyzable CSV format.
  • Configurable Benchmarks: Benchmark parameters are now configured via YAML files (config.yaml), allowing for easy customization of bucket types, file sizes, chunk sizes, concurrency levels, and the number of read ranges.
  • New Dependencies for Testing: Updated setup.py to include a new testing extra dependency group, adding pytest-benchmark, numpy, psutil, py-cpuinfo, and PyYAML to support the new benchmarking infrastructure.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 benchmarking for read ranges. The changes include adding a num_ranges parameter to benchmark configurations and tests, and updating the download logic to batch range requests. My review has identified a few issues: a potential bug in the benchmark tests where the num_ranges parameter is not correctly propagated, some commented-out code that should be removed, a change in a sample snippet that reduces its functionality, and a potentially unintentional change to the .gitignore file. Please see the detailed comments for suggestions.

Comment on lines +53 to +55
async def download_chunks_using_mrd_async(
client, filename, other_params, chunks, num_ranges=2
):
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The default value num_ranges=2 is used when num_ranges is not explicitly passed. This is the case for test_downloads_single_proc_multi_coro and test_downloads_multi_proc_multi_coro tests, as the num_ranges parameter from the configuration is not being passed down to this function through its callers (e.g., download_files_using_mrd_multi_coro). This means these tests will always run with num_ranges=2 instead of the values specified in config.yaml, which could lead to misleading benchmark results. The num_ranges parameter should be threaded through the call stack for these tests.

pylintrc.test

# Benchmarking results and logs
__benchmark_results__/**
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

It seems the line to ignore benchmark results has been removed. Generated files like benchmark results are usually not checked into source control to avoid bloating the repository and causing conflicts. It's recommended to keep this line.

Comment on lines +70 to +74
options=(
# ("grpc.primary_user_agent", "gccl/3.8.1"),
# ("grpc.experimental.tcp_tx_zerocopy_enabled", True),
# ("x-goog-api-client", "gl-python-local/3.8.0"),
),
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Commented-out code should be avoided in the codebase as it can become stale and reduce readability. If these options are for debugging or future use, they should be removed and can be retrieved from version control history if needed. The options tuple can be left empty.

            options=(),

if __name__ == "__main__":
list_blobs_with_prefix(
bucket_name=sys.argv[1], prefix=sys.argv[2], delimiter=sys.argv[3]
bucket_name=sys.argv[1], prefix=sys.argv[2]
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This change removes the ability to specify a delimiter from the command line. The previous implementation was brittle as it would crash if the delimiter was not provided. A more robust approach would be to handle the delimiter as an optional argument, which would preserve the functionality of the sample.

Suggested change
bucket_name=sys.argv[1], prefix=sys.argv[2]
bucket_name=sys.argv[1], prefix=sys.argv[2], delimiter=sys.argv[3] if len(sys.argv) > 3 else None

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: xl Pull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant