Skip to content

Commit a5478ce

Browse files
committed
perf(h2): increase header table size to 64KB and enable Huffman encoding
1 parent f2133fa commit a5478ce

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/TurboHTTP/Http2Options.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public sealed class Http2Options
4848
/// Advertised via SETTINGS_HEADER_TABLE_SIZE in the connection preface.
4949
/// Default is 4,096 (RFC 7541 default).
5050
/// </summary>
51-
public int HeaderTableSize { get; set; } = 4_096;
51+
public int HeaderTableSize { get; set; } = 65_536;
5252

5353
/// <summary>
5454
/// Maximum number of reconnect attempts when a TCP connection drops with in-flight requests.

src/TurboHTTP/Protocol/Http2/StateMachine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public StateMachine(TurboClientOptions options, IStageOperations ops)
6060
_tracker = new StreamTracker(1, options.Http2.MaxConcurrentStreams);
6161
_connection = new ConnectionState(options.Http2.InitialConnectionWindowSize,
6262
options.Http2.InitialStreamWindowSize);
63-
_requestEncoder = new RequestEncoder(maxFrameSize: 16_384);
63+
_requestEncoder = new RequestEncoder(useHuffman: true, maxFrameSize: 16_384);
6464
_statePoolCapacity = Math.Min(
6565
_tracker.MaxConcurrentStreams > 0 ? _tracker.MaxConcurrentStreams : 100,
6666
MaxStatePoolCapacity);

0 commit comments

Comments
 (0)