-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
breakingImplementing this issue could cause existing code to no longer compile or have different behavior.Implementing this issue could cause existing code to no longer compile or have different behavior.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.optimizationstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Description
Extracted from #13980.
Here's an example of using TCP fastopen to send data along with the tcp connection:
struct msghdr mh = {
.msg_name = (void *)sa,
.msg_namelen = sl,
.msg_iovlen = 2,
.msg_iov = (struct iovec [2]){
{ .iov_base = (uint8_t[]){ ql>>8, ql }, .iov_len = 2 },
{ .iov_base = (void *)q, .iov_len = ql } }
};
int fd = socket(family, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
if (!setsockopt(fd, IPPROTO_TCP, TCP_FASTOPEN_CONNECT, &(int){1}, sizeof(int))) {
r = sendmsg(fd, &mh, MSG_FASTOPEN|MSG_NOSIGNAL);TCP_QUICKACK is another option that could be enabled in setsockopt. Both options are intended to reduce latency.
This issue is to change the std lib API for making an HTTPS request to take advantage of these things, and see if we can reduce the latency of establishing a connection. For HTTP GET requests it should do the same but with the HTTP header instead of the TLS ClientHello.
softprops, ghishadow and maxmilton
Metadata
Metadata
Assignees
Labels
breakingImplementing this issue could cause existing code to no longer compile or have different behavior.Implementing this issue could cause existing code to no longer compile or have different behavior.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.optimizationstandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.