Skip to content
This repository was archived by the owner on Mar 31, 2026. It is now read-only.

Commit dbe9d8b

Browse files
feat: Add micro-benchmarks for writes comparing standard (regional) vs rapid (zonal) buckets. (#1707)
* Add performance microbenchmarking suite for Writes * This compares Regional (Standard Storage) with Zonal (Rapid Storage) buckets. * Regional uses JSON wheres Zonal uses gRPC bidi --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 1917649 commit dbe9d8b

File tree

7 files changed

+585
-7
lines changed

7 files changed

+585
-7
lines changed

tests/perf/microbenchmarks/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@ pytest --benchmark-json=output.json -vv -s tests/perf/microbenchmarks/reads/test
1515

1616
To run a single test, append `::` followed by the test name to the file path.
1717

18-
Example:
18+
Examples:
1919
```bash
2020
pytest --benchmark-json=output.json -vv -s tests/perf/microbenchmarks/reads/test_reads.py::test_downloads_single_proc_single_coro
2121
```
22+
```bash
23+
pytest --benchmark-json=output.json -vv -s tests/perf/microbenchmarks/writes/test_writes.py::test_uploads_single_proc_single_coro
24+
```
2225

2326
## Configuration
2427

tests/perf/microbenchmarks/conftest.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
AsyncAppendableObjectWriter,
2727
)
2828
from google.cloud.storage._experimental.asyncio.async_grpc_client import AsyncGrpcClient
29+
from tests.perf.microbenchmarks.writes.parameters import WriteParameters
2930

3031
_OBJECT_NAME_PREFIX = "micro-benchmark"
3132

@@ -135,10 +136,16 @@ def _create_files(num_files, bucket_name, bucket_type, object_size, chunk_size=1
135136
@pytest.fixture
136137
def workload_params(request):
137138
params = request.param
138-
files_names = _create_files(
139-
params.num_files,
140-
params.bucket_name,
141-
params.bucket_type,
142-
params.file_size_bytes,
143-
)
139+
if isinstance(params, WriteParameters):
140+
files_names = [
141+
f"{_OBJECT_NAME_PREFIX}-{uuid.uuid4().hex[:5]}"
142+
for _ in range(params.num_files)
143+
]
144+
else:
145+
files_names = _create_files(
146+
params.num_files,
147+
params.bucket_name,
148+
params.bucket_type,
149+
params.file_size_bytes,
150+
)
144151
return params, files_names

tests/perf/microbenchmarks/writes/__init__.py

Whitespace-only changes.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agre