[ 
https://issues.apache.org/jira/browse/AVRO-49?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12723303#action_12723303
 ] 

Doug Cutting commented on AVRO-49:
----------------------------------

> On average, this will waste one bit per int if all numbers are positive.
> [ ... ] perhaps the most common case will be the length fields in all 
> "string" and "bytes" fields,

For strings less than 64 bytes, no space is added. The worst case is if all 
strings are 64 bytes, then the added space is about 0.2%.  As they get longer, 
the added space diminishes.  When strings average around 1kB, this bit adds 
just 0.01%.  So, yes, there is some waste, but not a lot.

Design-wise this gets to the question of whether Avro should include the 
intersection or the union of common programming language data representation 
features.  My feeling is that compatibility will be simplified if we aim more 
for the intersection, so long as that intersection is not too impoverished or 
inefficient.  There are judgement calls to be made in this analysis, but 
unsigned numbers seem in the "union" camp to me. 

> Efficient positive varints
> --------------------------
>
>                 Key: AVRO-49
>                 URL: https://issues.apache.org/jira/browse/AVRO-49
>             Project: Avro
>          Issue Type: Improvement
>          Components: spec
>            Reporter: Ismael Juma
>
> Hi,
> Avro looks like an interesting project, so I was looking at the 
> specification. I noticed that varints use zig-zag encoding which is a good 
> signed representation. However, id-like values are very common and they are 
> often always positive. I think it would be nice to support them as 
> efficiently as possible too (like Protocol Buffers, for example). Would 
> something like this be considered at all?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to