Skip to content

0.9.0

Latest

Choose a tag to compare

@benoitc benoitc released this 06 Jun 06:15
402f769

Changed

  • A response's frames are written to the socket in one Transport:send instead of one send per frame. flush_stream_one_chunk/2 stages every flow-control-ready DATA frame (chunked to peer_max_frame_size, bounded by a 1 MiB cap) into a single write, and the respond/5 fast path writes [HEADERS | DATA...] in one go. A 100 KiB TLS response drops from 8 socket writes to 1, cutting per-frame gen_statem round-trips and TLS-record AEAD passes; large-body throughput roughly doubles (~37k to ~65k req/s on h2load -c64 -m32 over TLS). Flow control, framing and the public API are unchanged; multi-megabyte bodies still yield between cap-sized batches.
  • Active stream counts are maintained incrementally instead of folding the whole stream map on every new stream. count_peer_active_streams/2 and count_active_streams/1 are now O(1) reads of counters kept in sync by put_stream/3, removing an O(n^2) cost under stream churn (~13% h2load gain at c=100 m=100 over h2c).

Full changelog: https://github.com/benoitc/erlang_h2/blob/0.9.0/CHANGELOG.md