Skip to content

test(perf): add microbenchmarks for put operations#939

Merged
zhixiangli merged 2 commits into
fsspec:mainfrom
zhixiangli:feat-put-microbench
Jun 29, 2026
Merged

test(perf): add microbenchmarks for put operations#939
zhixiangli merged 2 commits into
fsspec:mainfrom
zhixiangli:feat-put-microbench

Conversation

@zhixiangli

Copy link
Copy Markdown
Collaborator

Introduces performance microbenchmarks for GCS upload (put) operations. Includes:

  • PutConfigurator and YAML configurations for single-threaded and multi-process put benchmarks.
  • Single-threaded and multi-process put benchmark test cases.
  • Unit tests for PutConfigurator.
  • Fixtures and setup in conftest.py.
  • Updated README documentation.
  • Fixed ResourceMonitor import and multi-process argument mismatch.

Introduces performance microbenchmarks for GCS upload (put) operations.
Includes:
- PutConfigurator and YAML configurations for single-threaded and multi-process put benchmarks.
- Single-threaded and multi-process put benchmark test cases.
- Unit tests for PutConfigurator.
- Fixtures and setup in conftest.py.
- Updated README documentation.
- Fixed ResourceMonitor import and multi-process argument mismatch.

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

Copy link
Copy Markdown
Contributor

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 a new 'put' benchmark group to evaluate the performance of uploading local files to GCS, including single-threaded and multi-process test cases, configuration files, and setup fixtures. The review feedback highlights three key areas for improvement: correcting the parameter name in gcs.put from chunksize to block_size to ensure configured chunk sizes are respected, optimizing the CPU-intensive os.urandom file generation by repeating a smaller pre-generated block, and reducing or diversifying the default 4 GB benchmark file size to prevent excessively slow and expensive runs in CI/CD environments.

Comment thread gcsfs/tests/perf/microbenchmarks/put/test_put.py
Comment thread gcsfs/tests/perf/microbenchmarks/conftest.py
Comment thread gcsfs/tests/perf/microbenchmarks/put/configs.yaml
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.77%. Comparing base (3bd3383) to head (7b481ac).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #939   +/-   ##
=======================================
  Coverage   89.77%   89.77%           
=======================================
  Files          16       16           
  Lines        3569     3569           
=======================================
  Hits         3204     3204           
  Misses        365      365           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhixiangli zhixiangli marked this pull request as ready for review June 26, 2026 12:23
def _put_op(gcs, local_path, remote_path, chunk_size):
"""Upload a local file to a single remote path."""
try:
gcs.put(local_path, remote_path, chunksize=chunk_size)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we pass blocksize?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

put routes through _put_file, which takes chunksize (used directly as the resumable-upload part size). block_size is only a parameter of the open()/GCSFile path, so passing it to put would land in **kwargs and be ignored.

@zhixiangli zhixiangli merged commit 40945fb into fsspec:main Jun 29, 2026
10 checks passed
@zhixiangli zhixiangli deleted the feat-put-microbench branch June 29, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants