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 batched reads #3142

Merged
merged 1 commit into from
Jul 6, 2021
Merged

use batched reads #3142

merged 1 commit into from
Jul 6, 2021

Conversation

marten-seemann
Copy link
Member

@marten-seemann marten-seemann commented Apr 5, 2021

No description provided.

@codecov
Copy link

codecov bot commented Apr 6, 2021

Codecov Report

Merging #3142 (870c759) into master (e9d12b7) will increase coverage by 0.02%.
The diff coverage is 96.67%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3142      +/-   ##
==========================================
+ Coverage   85.40%   85.43%   +0.02%     
==========================================
  Files         134      134              
  Lines        9825     9840      +15     
==========================================
+ Hits         8391     8406      +15     
  Misses       1060     1060              
  Partials      374      374              
Impacted Files Coverage Δ
conn_oob.go 61.22% <96.67%> (+4.41%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e9d12b7...870c759. Read the comment docs.

@marten-seemann marten-seemann marked this pull request as ready for review April 7, 2021 04:41
oobBuffer: make([]byte, 128),
}, nil
batchConn: ipv4.NewPacketConn(c),
messages: make([]ipv4.Message, batchSize),
Copy link
Member

Choose a reason for hiding this comment

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

Maybe it's a bit less error-prone if you keep a [batchSize]ipv4.Message array and a currentMessages slice over that as members? That could allow you to get rid of the readPos tracking…

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

Successfully merging this pull request may close these issues.

2 participants