diff --git a/pkgs/_macro_client/lib/macro_client.dart b/pkgs/_macro_client/lib/macro_client.dart index 39ecb573..d5a0bac6 100644 --- a/pkgs/_macro_client/lib/macro_client.dart +++ b/pkgs/_macro_client/lib/macro_client.dart @@ -28,6 +28,8 @@ class MacroClient { final Map> _responseCompleters = {}; MacroClient._(this.macros, this.socket) { + // Nagle's algorithm slows us down >100x, disable it. + socket.setOption(SocketOption.tcpNoDelay, true); _host = RemoteMacroHost(this); _start(); } diff --git a/pkgs/_macro_server/lib/macro_server.dart b/pkgs/_macro_server/lib/macro_server.dart index 01146136..1fc12a75 100644 --- a/pkgs/_macro_server/lib/macro_server.dart +++ b/pkgs/_macro_server/lib/macro_server.dart @@ -121,7 +121,10 @@ class _Connection { /// Responses to query requests from the macro. Stream get responses => _responsesController.stream; - _Connection(this.socket); + _Connection(this.socket) { + // Nagle's algorithm slows us down >100x, disable it. + socket.setOption(SocketOption.tcpNoDelay, true); + } @override String toString() => '_Connection($descriptions)';