fluent / fluent/fluent-logger-python
Use actual bytesarray/memoryview instead of bytes concatenation
- 主要言語
- Python
- スター
- 457
- フォーク
- 138
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- backend
- issue の種類
- リファクタリング
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100