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

Use double buffers in EventLoop #270

Merged
merged 4 commits into from
Nov 16, 2022
Merged

Use double buffers in EventLoop #270

merged 4 commits into from
Nov 16, 2022

Conversation

kate-osborn
Copy link
Contributor

Resolves FIXME:

Making an entirely new buffer is inefficient and multiplies memory operations.
Use a double-buffer approach - create two buffers and exchange them between the producer and consumer
routines. NOTE: pass-by-reference, and reset buffer to length 0, but retain capacity.

@kate-osborn kate-osborn requested a review from a team as a code owner October 14, 2022 21:44
@github-actions github-actions bot added the bug Something isn't working label Oct 14, 2022
internal/events/loop.go Outdated Show resolved Hide resolved
internal/events/events_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

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

👍

@kate-osborn kate-osborn merged commit 6520a4d into main Nov 16, 2022
@kate-osborn kate-osborn deleted the fix/use-double-buffer branch November 16, 2022 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants