Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'encoding': 0.05; 'bytes,': 0.09; 'bytes.': 0.09; 'claimed': 0.09; 'counting': 0.09; 'mixed': 0.09; 'output,': 0.09; 'will,': 0.09; 'python': 0.11; 'jan': 0.12; '384': 0.16; '386': 0.16; 'bits.': 0.16; 'encoding.': 0.16; 'integers,': 0.16; 'quoted': 0.16; 'shared.': 0.16; 'worse.': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'else,': 0.19; 'thu,': 0.19; 'seems': 0.21; 'feb': 0.22; 'header :User-Agent:1': 0.23; 'bytes': 0.24; 'earlier': 0.24; "haven't": 0.24; 'looks': 0.24; '---': 0.24; 'question': 0.24; "i've": 0.25; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'code': 0.31; 'that.': 0.31; 'subject:skip:i 10': 0.31; 'lists': 0.32; 'raw': 0.33; 'sense': 0.34; 'could': 0.34; 'something': 0.35; 'but': 0.35; 'scheme': 0.36; 'subject:new': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'does': 0.39; 'extremely': 0.39; 'to:addr:python.org': 0.39; 'dave': 0.60; 'ian': 0.60; 'length': 0.61; 'strictly': 0.61; "you're": 0.61; 'charset:windows-1252': 0.65; 'between': 0.67; 'received:74.208': 0.68; 'ranges': 0.74; '2015': 0.84; 'grew': 0.84; 'presumably': 0.84; 'angel': 0.91; 'from.': 0.93 Date: Thu, 19 Feb 2015 13:46:23 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: python implementation of a new integer encoding algorithm. References: <515047c1-a20d-430e-a029-1c2d77db2f1a@googlegroups.com> <2a717ffb-d61d-4407-9082-1c17cd7ee573@googlegroups.com> <993f64c3-fc85-48a7-9d02-a4f12ecb33c6@googlegroups.com> <54E62A68.4010603@davea.name> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:UKk2GYknMyBC5CBw8uG+vJL9bzHXTeJVmYlK59FmZRR pjH8RNn4IQcbmx8EvdT0lD/qlsnFFWijY39R5c/xVCWqlrCMoS d8eODgfBwVqtRe/eJ77gB9EVH/1wTK/uy7b0w39PY/mEvsb+kq XPmql3c7o6HI8u9Oifvg2UiWlljgnJJK9SeBWB3wp5wZzr+qj/ 492mN+jqhlkDW4vKLNJ9iLQh5PQuuE1Y/cFhOkvsVJTNgdh3aw kCPSQBIosY/YMwBMXJ/HzBsK5vFcR6Lw2Xjw+7t0CUNkLSmeAg xYfuJoDwCnDfkykWoD3ShmD5kVG9Jv6PMGXWEstKBIpx2ogmER +hwU4tiRT6Ii7I/6KedI= X-UI-Out-Filterresults: notjunk:1; X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 53 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424371589 news.xs4all.nl 2867 [2001:888:2000:d::a6]:33338 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:85922 On 02/19/2015 01:32 PM, Ian Kelly wrote: > On Thu, Feb 19, 2015 at 11:24 AM, Dave Angel wrote: >> Here's a couple of ranges of output, showing that the 7bit scheme does >> better for values between 384 and 16379. >> >> 382 2 80fe --- 2 7e82 >> 383 2 80ff --- 2 7f82 >> 384 3 810000 --- 2 0083 >> 384 jan grew 3 810000 >> 385 3 810001 --- 2 0183 >> 386 3 810002 --- 2 0283 >> 387 3 810003 --- 2 0383 >> 388 3 810004 --- 2 0483 >> 389 3 810005 --- 2 0583 >> >> 16380 3 813e7c --- 2 7cff >> 16380 jan grew 3 813e7c >> 16380 7bit grew 2 7cff >> 16381 3 813e7d --- 2 7dff >> 16382 3 813e7e --- 2 7eff >> 16383 3 813e7f --- 2 7fff >> 16384 3 813e80 --- 3 000081 >> 16384 7bit grew 3 000081 >> 16385 3 813e81 --- 3 010081 >> 16386 3 813e82 --- 3 020081 >> 16387 3 813e83 --- 3 030081 >> 16388 3 813e84 --- 3 040081 >> 16389 3 813e85 --- 3 050081 >> >> In all my experimenting, I haven't found any values where the 7bit scheme >> does worse. It seems likely that for extremely large integers, it will, but >> if those are to be the intended distribution, the 7bit scheme could be >> replaced by something else, like just encoding a length at the beginning, >> and using raw bytes after that. > > It looks like you're counting whole bytes, not bits. That would be > important since the "difficult" encoding uses fractional bytes. > Not the implementation that was shared. I've only seen one set of Python code for "difficult", and it was strictly bytes. As i said earlier in the message you quoted from. Naturally, I question whether the original description makes sense for sub-bytes, since it was claimed that these are NOT for lists or sequences of arbitrary integers, but only for a single one at a time. Presumably mixed with other data which may or may not like bit encoding. -- DaveA