diff options
author | 2021-10-13 14:29:03 -0700 | |
---|---|---|
committer | 2021-10-13 14:29:03 -0700 | |
commit | 6d997ab20185e57948536168b961100031f42351 (patch) | |
tree | 8049b8fba0c2402aae5bb1707989f7e9257a8e9f | |
parent | 8f7f4ae72f720b713dc1e0c935c2db4306663435 (diff) | |
download | bun-6d997ab20185e57948536168b961100031f42351.tar.gz bun-6d997ab20185e57948536168b961100031f42351.tar.zst bun-6d997ab20185e57948536168b961100031f42351.zip |
[fetch] Slight perf improvement
-rw-r--r-- | src/http_client.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/http_client.zig b/src/http_client.zig index cfa21a5f7..09614636d 100644 --- a/src/http_client.zig +++ b/src/http_client.zig @@ -221,6 +221,9 @@ pub fn connect( ) !tcp.Client { var client: tcp.Client = try tcp.Client.init(tcp.Domain.ip, .{ .close_on_exec = true }); const port = this.url.getPortAuto(); + client.setNoDelay(true) catch {}; + client.setReadBufferSize(http_req_buf.len) catch {}; + client.setQuickACK(true) catch {}; // if (this.url.isLocalhost()) { // try client.connect( @@ -230,6 +233,7 @@ pub fn connect( // } else if (this.url.isDomainName()) { var stream = try std.net.tcpConnectToHost(default_allocator, this.url.hostname, port); client.socket = std.x.os.Socket.from(stream.handle); + // } // } else if (this.url.getIPv4Address()) |ip_addr| { // try client.connect(std.x.os.Socket.Address(ip_addr, port)); |