Re: [Cbor] Interactions of packed CBOR and tags

Carsten Bormann <> Thu, 03 September 2020 16:53 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 7BDC13A0FD9 for <>; Thu, 3 Sep 2020 09:53:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id SsrfWcBRpP84 for <>; Thu, 3 Sep 2020 09:53:25 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 8FAF33A0FD3 for <>; Thu, 3 Sep 2020 09:53:25 -0700 (PDT)
Received: from [] ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPSA id 4Bj6M74XQGzyrq; Thu, 3 Sep 2020 18:53:23 +0200 (CEST)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.\))
From: Carsten Bormann <>
In-Reply-To: <016f01d6820b$bc7d7cc0$35787640$>
Date: Thu, 3 Sep 2020 18:53:23 +0200
Cc: Brendan Moran <>,
X-Mao-Original-Outgoing-Id: 620844802.855808-6c40fe1e7a078da369024282e5e66bfb
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <00c101d67cb5$2588b790$709a26b0$> <> <00cc01d67cc9$766c7b60$63457220$> <> <016f01d6820b$bc7d7cc0$35787640$>
To: Jim Schaad <>
X-Mailer: Apple Mail (2.3608.
Archived-At: <>
Subject: Re: [Cbor] Interactions of packed CBOR and tags
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 03 Sep 2020 16:53:29 -0000

On 2020-09-03, at 18:03, Jim Schaad <> wrote:
> 6([ "www.", "merch", "datatracker"], ["""], 224(225(simple(2))), 224(226(simple(2)))] 
> Where we have pulled both prefix and postfix strings extracted and maximize the amount of commonality.  

I like the idea of adding suffix packing.

In the current proposal, to distinguish shared items from prefix packing, we have

— a separate table (and thus number space), which makes sense if prefixes are rarely used as shared items and v.v. (using a prefix as shared item just requires prefixing it to the empty item, though);
— separate referents (one with no content, one with the content the prefix is prefixed to).

Adding suffix packing, we could have a third table and a third set of referents (also with content).  We also could have just separate referents, sharing the table/number space, if that makes sense.

We could also rethink the whole separation of shared items from prefix/suffix items in this process.

As Brendan says, being able to optimize the tables so the frequently used items land in the areas that have short referents is important.

[Apologies for using the term referent, which isn’t even in my dictionaries with the meaning I’m using it for (the thing that references).  But that’s the usage I learned when I learned about them in the 1970s… [1]]

Making prefix/suffix packing well-defined for arrays isn’t hard.  For maps, there is no difference (assuming we are always handling full key/value pairs — just doing a single key or a value can be done by sharing items).

I don’t think we want to address what would be “deterministic packing”.

Grüße, Carsten