Skip to content

connect-zig v0.2.0

Choose a tag to compare

@c4milo c4milo released this 17 Nov 17:01
· 196 commits to main since this release

It builds on colibri v0.18.1 and on stdx v0.1.2, with Zig 0.16.0. Two changes to the API are
marked below.

Added

  • brotli both ways. A program places connect.BrotliEncoder in Encoders.brotli, and a server
    or a client then writes br: stdx's encoder at level 1 with a 128 KiB window, in 519 KiB.
    Before, br was read and not written.

Changed

  • CI runs connectrpc's conformance suite v1.0.7, where it ran v1.0.4: the server passes its 3714
    cases, and the client its 10711.
  • JSON encode writes a message with no member, {}, in one stdx call: tree's JSON encode takes
    27% fewer instructions.
  • Changes the API. compression.compress and compression.choose take the encoders as
    *const Encoders, since Encoders holds three pointers now. A call passes &encoders.
  • connect-zig builds on colibri v0.18.1 and on stdx v0.1.2, the tag colibri pins. A program that
    names stdx itself pins that tag too, so it links one stdx.
  • A server reads a large request body in a time that grows with its length. On colibri v0.17.3
    the time grew with the square of the pieces the body arrived in.
  • Changes the API. rpc.failure_of takes the pool's response, *const client.Response, in
    place of its client.Result, so it reads the code of a reset stream.
  • A call whose stream the server reset ends with the code gRPC's table gives the reset, over h2
    and h3: CANCEL gives canceled, ENHANCE_YOUR_CALM resource_exhausted, INADEQUATE_SECURITY
    permission_denied, and each other code internal. Before, each reset gave unavailable.

Fixed

  • Over HTTP/1.1, a stream that answers before its request ends keeps its connection, and a
    response that ends its connection says Connection: close, so a client never sends its next
    request into a closed connection (colibri v0.17.3).
  • A request to a path with no route gets its 404, 405, 501 or 503 when the connection is busy,
    where over HTTP/2 it could read a reset with CANCEL (colibri v0.17.3).
  • A Connect GET writes its query in the protocol's order: connect, base64, compression,
    encoding, then message. connectrpc's conformance suite v1.0.7 checks it.

Checked

  • The routed call runs in tables of 16 and 256 routes, and the performance gate counts its
    instructions there too.
  • A full-stack check loads connect-zig's OTLP sink beside OpenTelemetry's Collector, Vector and
    Rotel, each on one core. In CI's run 172, connect-zig held 4.0 times the Collector's spans a
    second on x86-64 and 5.0 times on arm64, with p99 under 100 ms. It held 12.0 and 13.3 times
    Vector's over TLS, and 3.0 and 3.3 times Rotel's in cleartext.

Note, 2026-11-17: the ratios above come from run 172, whose climb used coarse steps, so each
could be off by up to half. CI's run 177 refined each climb. One core of connect-zig held 3.0 and
3.4 times the Collector's spans a second over TLS, on x86-64 and arm64, and 9.5 and 10.4 times
Vector's. In cleartext it held 2.9 and 3.5 times Rotel's. The README on main gives these
numbers.