fluent / fluent/fluent-logger-python

Use actual bytesarray/memoryview instead of bytes concatenation

Open
#113 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
457
Forks
138
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.