-
Notifications
You must be signed in to change notification settings - Fork 126
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
Large transport bufs #806
Large transport bufs #806
Conversation
6fbbe53
to
07384bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would a smaller buffer for test configurations help the tests run faster? Or is 1M still small enough we won't notice?
@@ -1852,7 +1852,7 @@ mod tests { | |||
if let ConnectionEvent::RecvStreamReadable { stream_id } = e { | |||
if stream_id == request_stream_id { | |||
// Read the DATA frame. | |||
let mut buf = [1_u8; 0xffff]; | |||
let mut buf = vec![1_u8; Connection::stream_recv_buffer_size()]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this an associated function and not an exported constant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think exported constant is better. I'll follow up with another PR.
@@ -280,7 +280,7 @@ pub struct TxBuffer { | |||
} | |||
|
|||
impl TxBuffer { | |||
const BUFFER_SIZE: usize = 0xFFFF; // 64 KiB | |||
pub const BUFFER_SIZE: usize = 0x10_0000; // 1 MiB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think that it makes sense to use a single common constant for these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think keeping them separate might come in handy, so let's keep them separate for now.
This should help to prevent STREAM_DATA_BLOCKED messages. Fix up max_data() test that broke when const was increased. Also expose TxBuffer::BUFFER_SIZE to avoid raw numbers as much as possible.
Add static const methods to get send and receive buffer sizes. This is useful for testing in http3 crate, for example. Alter tests in http3 and transport crates to not assume a given buffer size.
07384bd
to
b6f89b1
Compare
Followup to mozilla#806, this is simpler than const methods on Connection. Note that while we can change these constants now, setting them to different values will cause some tests to fail. Spending time to fix tests for different const values is not justified yet.
Followup to mozilla#806, this is simpler than const methods on Connection. Note that while we can change these constants now, setting them to different values will cause some tests to fail. Spending time to fix tests for different const values is not justified yet.
Followup to mozilla#806, this is simpler than const methods on Connection. Note that while we can change these constants now, setting them to different values will cause some tests to fail. Spending time to fix tests for different const values is not justified yet.
Followup to #806, this is simpler than const methods on Connection. Note that while we can change these constants now, setting them to different values will cause some tests to fail. Spending time to fix tests for different const values is not justified yet.
Increase transport send & recv bufs from 64K to 1M. Most of this PR is updating tests in http3 and transport to not depend on buffers being a certain size.