Re: [quicwg/base-drafts] Make using static table and Huffman encoding in QPACK opt-in (#3622)

Lars Eggert <notifications@github.com> Mon, 04 May 2020 15:29 UTC

Return-Path: <noreply@github.com>
X-Original-To: quic-issues@ietfa.amsl.com
Delivered-To: quic-issues@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E67EB3A0B88 for <quic-issues@ietfa.amsl.com>; Mon, 4 May 2020 08:29:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.1
X-Spam-Level:
X-Spam-Status: No, score=-3.1 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=github.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 042zdx0zOP_x for <quic-issues@ietfa.amsl.com>; Mon, 4 May 2020 08:29:49 -0700 (PDT)
Received: from out-18.smtp.github.com (out-18.smtp.github.com [192.30.252.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9392B3A0B09 for <quic-issues@ietf.org>; Mon, 4 May 2020 08:29:42 -0700 (PDT)
Received: from github-lowworker-5fb2734.va3-iad.github.net (github-lowworker-5fb2734.va3-iad.github.net [10.48.19.27]) by smtp.github.com (Postfix) with ESMTP id C5AA86E53F9 for <quic-issues@ietf.org>; Mon, 4 May 2020 08:29:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=pf2014; t=1588606181; bh=a4ZH+D1TioX1tgzkw0rqZRkhQl7CQEwfflaquFUwPFs=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:List-ID: List-Archive:List-Post:List-Unsubscribe:From; b=YrRgU4DwJxJ3MApFrI4T8RqYstoD1U1rDNvPYNFv81b5yp/IK44c5scdar66rIjhd ESPwb9BIYQX89fBCkS4ZZ7vxIImLGP01JZb/RFoOKMMja66Pn1UVn54P/8S9O7ebsL b/ZIF8t/jzgmV9ngn4NMOPaHaMvXXlfi3+riP54s=
Date: Mon, 04 May 2020 08:29:41 -0700
From: Lars Eggert <notifications@github.com>
Reply-To: quicwg/base-drafts <reply+AFTOJK7WDMOHIKB3I5Z2XPV4XQK6LEVBNHHCIZJKDU@reply.github.com>
To: quicwg/base-drafts <base-drafts@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Message-ID: <quicwg/base-drafts/issues/3622/623533385@github.com>
In-Reply-To: <quicwg/base-drafts/issues/3622@github.com>
References: <quicwg/base-drafts/issues/3622@github.com>
Subject: Re: [quicwg/base-drafts] Make using static table and Huffman encoding in QPACK opt-in (#3622)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="--==_mimepart_5eb034e5b7167_7ba73fde47ecd9602792f2"; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Precedence: list
X-GitHub-Sender: larseggert
X-GitHub-Recipient: quic-issues
X-GitHub-Reason: subscribed
X-Auto-Response-Suppress: All
X-GitHub-Recipient-Address: quic-issues@ietf.org
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic-issues/4vp2wfkw6hifr9rEWDQfw9YjWDY>
X-BeenThere: quic-issues@ietf.org
X-Mailman-Version: 2.1.29
List-Id: Notification list for GitHub issues related to the QUIC WG <quic-issues.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic-issues/>
List-Post: <mailto:quic-issues@ietf.org>
List-Help: <mailto:quic-issues-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic-issues>, <mailto:quic-issues-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 04 May 2020 15:29:51 -0000

With the ARM toolchain for the Cortex M4, here is the object size (second column) of the various functions in `h3zero.c`, largest first:
```
000007a8 00001010 D h3zero_qpack_huffman_table
00000000 00000630 D qpack_static
00000eb8 000003e8 T h3zero_parse_data_stream
00000c70 00000248 T h3zero_parse_qpack_header_frame
00000814 00000228 T hzero_qpack_huffman_decode
00000638 00000170 D h3zero_qpack_index
00000a3c 00000164 T h3zero_parse_qpack_header_value
000001e4 00000100 T h3zero_qpack_int_decode
000004c4 000000d4 T h3zero_create_post_header_frame
00000ba0 000000d0 T h3zero_get_interesting_header_type
0000008c 000000b8 T h3zero_qpack_int_encode
00000598 000000b8 T h3zero_create_request_header_frame
00000700 000000a4 T h3zero_create_bad_method_header_frame
00000370 00000094 T h3zero_get_content_type_by_name
000002e4 0000008c T h3zero_get_method_by_name
00000444 00000080 T h3zero_encode_content_type
00000014 00000078 T h3zero_varint_decode
00000174 00000070 t h3zero_qpack_literal_plus_ref_encode
000007a4 00000070 T h3zero_delete_data_stream_state
00000650 00000060 T h3zero_create_response_header_frame
000006b0 00000050 T h3zero_create_not_found_header_frame
00000404 00000040 T h3zero_parse_status
00000144 00000030 t h3zero_qpack_code_encode
00000000 00000014 T h3zero_varint_skip
0000006c 00000007 r h3zero_default_setting_frame_val
00000634 00000004 D nb_h3zero_qpack_index
000017b8 00000004 D nb_h3zero_qpack_huffman_table
00000630 00000004 D h3zero_qpack_nb_static
00000068 00000004 R h3zero_default_setting_frame_size
000017bc 00000004 D h3zero_default_setting_frame
```
So the table alone is about 1K. That's not great, but I'm also not sure if `qpack_static` is the most compact representation of this data.

In terms of code size, there are some easy gains just by using minimally-sized integer types. For example, only changing `index` to `uint8_t` and `enum_as_int` to `uint16_t` in `st_h3zero_qpack_static_t` saves you 368 bytes. If you can get rid of `uint64_t` as much as possible, that would probaly save you 1-2K in size right there. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/3622#issuecomment-623533385