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 buffered channels for websocket listener. #1478

Closed
arijitAD opened this issue Mar 18, 2021 · 1 comment
Closed

Use buffered channels for websocket listener. #1478

arijitAD opened this issue Mar 18, 2021 · 1 comment
Assignees

Comments

@arijitAD
Copy link
Contributor

Issue summary

  • Since, an unbuffered channel is blocking, it is 4x slower than a buffered channel.
  • Channels should always be buffered unless we need blocking behaviour.
BenchmarkBufferedChannelEmptyStruct-8         23657084            49.9 ns/op
BenchmarkBufferedChannelOneByte-8             21230530            54.6 ns/op      18.31 MB/s

BenchmarkUnbufferedChannelEmptyStruct-8        6075384            177 ns/op
BenchmarkUnbufferedChannelOneByte-8            6341457            184 ns/op       5.44 MB/s

Other information and links

@edwardmack
Copy link
Member

Closed, this issue was addressed in PR #1668.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants