googleapis / googleapis/google-cloud-python

Performance regression: Datastore queries slower in 2.21.0 vs 2.20.1

Đang mở
#15,335 1 bình luận 0 reaction 1 người được giao Được @iam-ethan-huang nhận Xem trên GitHub
api: datastore
Ngôn ngữ chính
Python
Star
5.4k
Fork
1.8k
Merge trung bình
3 ngày 4 giờ
Pull request đã merge (30 ngày)
122

Mô tả

#### 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)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.