fluent / fluent/fluent-logger-python
Use actual bytesarray/memoryview instead of bytes concatenation
- Ngôn ngữ chính
- Python
- Star
- 457
- Fork
- 138
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Bytes concatenation such as this is extremely wasteful and is never a good idea.
https://github.com/fluent/fluent-logger-python/blob/master/fluent/sender.py#L137
```python
# buffering
if self.pendings:
self.pendings += bytes_
bytes_ = self.pendings
```
Python has mutable buffers that should be used to ensure that the objects aren't created needlessly putting pressure on GC and wasting CPU with double-copy concatenation.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Start in fluent/sender.py at line 137 and trace the buffering path around self.pendings. Read the surrounding sender implementation to compare the proposed bytearray or memoryview approach with the current concatenation. Done means buffered sends no longer repeatedly concatenate bytes while preserving the sender's existing behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- backend
- Loại issue
- Tái cấu trúc
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 38/100