googleapis / googleapis/google-cloud-python

Performance regression: Datastore queries slower in 2.21.0 vs 2.20.1

オープン
#15,335 コメント 1 件 リアクション 0 件 担当者 1 名 @iam-ethan-huang が担当を希望しています GitHub で見る
api: datastore
主要言語
Python
スター
5.4k
フォーク
1.8k
平均マージ
3日 4時間
マージ済み PR(30日)
122

説明

#### Environment details

- OS type and version: [Ubuntu 22.04 from google-22-full/python312 base image](https://docs.cloud.google.com/docs/buildpacks/stacks#google-22-full)
- Python version: 3.12
- pip version: using `google.python.pip 0.9.2` from buildpack
- `google-cloud-datastore` version: `2.21.0`
- Other relevant packages:
```
grpcio==1.76.0
grpcio-status==1.71.2
protobuf==5.29.5
```

#### Description of the Problem
After upgrading google-cloud-datastore from **2.20.1** to **2.21.0**, Datastore queries became significantly slower.

In my production workload using NDB, a query that normally takes about **6 seconds** with version **2.20.1** now takes around **20 seconds** with **2.21.0.**

Even when bypassing NDB and using the Datastore client directly, there is still a consistent slowdown.
Running the same query 15 times:
- **2.20.1**: ~6.06 seconds (average)
- **2.21.0**: ~11.03 seconds (average)

No other dependencies in the project changed (I've attach my full requirements before and after update below).

#### Code example

```python
client = datastore.Client()
query = client.query(kind="Enterprise") # This kind has many entities and larger payloads
results = list(query.fetch())
```

#### Requirements

[new-requirements.txt (using **2.21.0**)](https://github.com/user-attachments/files/23610404/new-requirements.txt)

[old-requirements.txt (using **2.20.1**)](https://github.com/user-attachments/files/23610445/old-requirements.txt)

(These are the full requirements, and involve a lot more than datastore)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。