Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(octetcounting): re-use readers #18

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Conversation

sinkingpoint
Copy link
Contributor

Solves #16

This adds a sync.Pool that stores bufio.Readers that can be re-used across messages. Previously, we were creating a new bufio.Reader for each new message. This allocates a buffer and results in a malloc call for each new message which can be very inefficient in high throughput environments. By introducing a sync.Pool we are able to re-use those allocations across multiple messages, dramatically reducing the cpu hit.

Signed-off-by: sinkingpoint <[email protected]>
@leodido leodido changed the title Re-use Syslog Readers feat(octetcounting): re-use readers Sep 18, 2024
@leodido leodido self-assigned this Sep 18, 2024
@leodido leodido self-requested a review September 18, 2024 09:33
Copy link
Owner

@leodido leodido left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@leodido leodido merged commit 42a2959 into leodido:develop Sep 18, 2024
5 checks passed
@leodido leodido added the enhancement New feature or request label Sep 18, 2024
codeboten referenced this pull request in open-telemetry/opentelemetry-collector-contrib Sep 24, 2024
…35398)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/leodido/go-syslog/v4](https://redirect.github.com/leodido/go-syslog)
| `v4.1.0` -> `v4.2.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fleodido%2fgo-syslog%2fv4/v4.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fleodido%2fgo-syslog%2fv4/v4.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fleodido%2fgo-syslog%2fv4/v4.1.0/v4.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fleodido%2fgo-syslog%2fv4/v4.1.0/v4.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>leodido/go-syslog (github.com/leodido/go-syslog/v4)</summary>

###
[`v4.2.0`](https://redirect.github.com/leodido/go-syslog/releases/tag/v4.2.0)

[Compare
Source](https://redirect.github.com/leodido/go-syslog/compare/v4.1.0...v4.2.0)

<!-- Release notes generated using configuration in .github/release.yml
at v4.2.0 -->

#### What's Changed

##### Features & Enhancements 🎉

- feat(octetcounting): re-use readers by
[@&#8203;sinkingpoint](https://redirect.github.com/sinkingpoint) in
[https://github.com/leodido/go-syslog/pull/18](https://redirect.github.com/leodido/go-syslog/pull/18)

##### Other Changes 🫶

- docs: fix link for octect counting section in the RFC by
[@&#8203;palash25](https://redirect.github.com/palash25) in
[https://github.com/leodido/go-syslog/pull/17](https://redirect.github.com/leodido/go-syslog/pull/17)

#### New Contributors

- [@&#8203;palash25](https://redirect.github.com/palash25) made their
first contribution in
[https://github.com/leodido/go-syslog/pull/17](https://redirect.github.com/leodido/go-syslog/pull/17)
- [@&#8203;sinkingpoint](https://redirect.github.com/sinkingpoint) made
their first contribution in
[https://github.com/leodido/go-syslog/pull/18](https://redirect.github.com/leodido/go-syslog/pull/18)

**Full Changelog**:
leodido/go-syslog@v4.1.0...v4.2.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any
time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIiwicmVub3ZhdGVib3QiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: opentelemetrybot <[email protected]>
Co-authored-by: Yang Song <[email protected]>
Co-authored-by: Alex Boten <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants