Dox patch release: 3 December 2026
This release is patch versions only. gRPC calls and WebSocket messages are much faster, and they use less memory. The release also fixes a stop of pipelined HTTP/1.1 connections. Your code needs no change.
Key takeaways
- gRPC is 2.9 times faster. A unary call goes from 77K to 223K calls a second. See Benchmark.
- WebSocket echo is 34% faster, with half the memory. The server memory goes from 40 MiB to 19 MiB at 512 connections.
- Pipelined WebSocket messages are 4.7 times faster. The answers of messages that come together go out in one write.
- Fix: pipelined HTTP/1.1. A connection with pipelined requests and async handlers could stop with no answer. See Fixes.
- Plain HTTP is the same.
GET /,/jsonand h2c did not change.- Easy to update. Run
dart pub upgrade. Then check Read before you update.
Versions
| Package | New version |
|---|---|
dox_http_native |
3.2.9 |
dox_core |
3.2.10 |
dox_grpc |
0.0.3 |
No change: all the other packages and the app template.
How to update
-
Get the new versions:
-
Build or start the app again. The new native library downloads automatically.
-
Read Read before you update.
There is no API change for apps. You do not need to run build_runner again.
Benchmark
We ran the same app on the previous packages from pub.dev and on this release. The previous packages are dox_http_native 3.2.8, dox_core 3.2.9 and dox_grpc 0.0.2. The rig is Linux in Docker on an Apple M2 laptop, with 2 server cores. The load tool has 6 cores. Each case runs for 15 seconds.
gRPC: 2.9 times more calls
A unary call with 1,024 HTTP/2 connections (h2load, 100 calls in flight on each).
2 server cores · Linux in Docker on an Apple M2 · mean of 2 rounds
WebSocket echo: 34% more messages, half the memory
An echo of one message at a time on each of 512 connections (gcannon).
2 server cores · Linux in Docker on an Apple M2 · 1 round
| Case | Before | This release | Memory |
|---|---|---|---|
| gRPC unary, 1,024 connections | 77K | 223K | 178-293 → 110 MiB |
| WebSocket echo, 512 connections | 394K | 526K | 40 → 19 MiB |
| WebSocket pipelined, 512 connections, 16 messages in flight | 802K | 3.74M | 48 → 36 MiB |
GET /json, HTTP/1.1, 256 connections |
253K | 256K | 11 → 11 MiB |
GET /json, h2c, 128 connections |
325K | 325K | 42 → 42 MiB |
Pipelined GET /, 512 connections |
3.18M | 3.08M | 21 → 21 MiB |
The second and third columns are requests or messages a second. The memory is the memory of the container during the test.
What the numbers do not show
- Plain HTTP did not change. The HTTP rows are the mean of 2 rounds. The differences are in the noise of the rig. This release does not change the HTTP path.
- The WebSocket rows have 1 round. We stopped the runs after the first round. The gRPC rows have 2 rounds.
- A first run had wrong numbers. In our first run, the old app had an older Dart SDK from the Docker cache. Then
/jsonlooked 10% slower in this release. With the same Dart SDK for the two apps,/jsonis the same. Use the same Dart SDK when you compare two versions. - This is one machine. Your numbers will be different.
Why gRPC is faster
A unary call calls its handler directly
Before, each call made a request stream, an answer stream and a subscription, also for a call with one message. Now a method with one request message calls its handler directly.
The request comes with its whole body
A gRPC request is usually one HEADERS frame and one DATA frame. When the two come in the same read, the native server gives the request to Dart with its whole body. There is no body stream and no ack.
The head and the trailer are encoded one time
The head of a call (content-type, grpc-accept-encoding) and the grpc-status: 0 trailer are the same for each call. Now Dox encodes them one time, with the new HeaderLines of dox_http_native.
One timer for all calls
Before, each call had its own idle timer. To make and to cancel a timer costs more than a small call. Now one timer for each idle timeout checks all calls of the isolate.
Routes with a dot use no regex
A gRPC route is /package.Service/{method}. A . in a route is a regex mark, so the router used a regex for each call. Now dox_core matches these routes with no regex. The routes match the same URLs as before.
Why WebSocket is faster
The native server reads and writes the frames
Before, the tungstenite library made a new buffer for each message and copied each message one more time. Now Rust reads and writes the frames in place. Rust also does the unmask, the messages in parts, ping and pong, and the close handshake.
The read buffer of each WebSocket starts at 4 KiB. It grows for a big message and goes back to 4 KiB after it. The Autobahn test suite gives the same results as before.
Messages that come together get one write
Before, each message of a batch went to the listener in its own microtask, and each answer went to the socket alone. Now all messages of a batch go to the listeners in one microtask. Then the answers go out in one write.
The order of the messages and of the close does not change.
New
For package authors: HeaderLines
HeaderLines is a set of header lines that the server checks and encodes one time:
final HeaderLines jsonHead = HeaderLines(<String, String>{
'content-type': 'application/json',
'cache-control': 'no-store',
});
response.headerLines = jsonHead;
- Set it on
NativeResponse.headerLines(sent after the headers) or onNativeResponse.trailerLines(sent after the trailers, HTTP/2 only). - A
content-typein the lines replaces the content type of the headers. - The constructor throws a
FormatExceptionfor a bad name or value. - It throws an
ArgumentErrorfor a name that the server sets:content-length,transfer-encoding,dateandconnection. Setcontent-encodingandcontent-rangeon the headers.
Fixes
- Pipelined HTTP/1.1 connections. A connection with pipelined requests could stop with no answer. This occurred when two or more connections sent pipelined requests at the same time, and the handlers were async. The native server did not find the request of an answer, and dropped the answer. Now it finds the request. An answer never went to a different request.
- An empty header name. An empty header name now throws a
FormatException, as all other bad names do.
Security
We compared this release with the HTTP/2, gRPC and WebSocket advisories of 2026. We found no gap:
- WebSocket messages in parts (as in CVE-2026-140001). A message in parts can not be bigger than the message limit, also with empty parts.
- Data after a close (as in CVE-2026-140002). After the close of the client, the server reads no more data from that WebSocket.
- Pipelined requests (as in CVE-2026-142457). A connection has a maximum of 64 requests that wait for an answer. Then the server stops the read of that connection until answers go out.
- Rust crates.
cargo auditfinds no advisory.rustlsis 0.23.46.
Read before you update
dox_grpc0.0.3 needsdox_http_native3.2.9.dart pub upgradegets them together.- A gRPC handler can not set
grpc-accept-encodingandgrpc-encoding. The call sets them. - A gRPC call with no message in or out ends after one to two times
GrpcOptions.idleTimeout. Before, it ended after exactly this time. The default stays 5 minutes.
Full list: the CHANGELOG of each package.