Optimizing Small Python Code

Barry Scott barry at barrys-emacs.org
Thu Jun 24 15:12:22 EDT 2021



> On 24 Jun 2021, at 16:58, Avi Gross via Python-list <python-list at python.org> wrote:
> 
> Now a has a length of 53!
> 
> It now looks like this:
> 
> b'x\x9c3\xe4R\x00\x03\x03.#8\x0bB\x1br\x19c\x88(\x18q\x99p!q\xc1\x00\xa6\xd1\x98\xcb\x14S\x03\x9a\n\x13.3\x82j \xb4\t\x94\x86\x99\t\x00\xdc\x87\x14\xb7'
> 
> So the shorter cheat program might now be:

The data is smaller, but at the cost of the code that knows how to decompress it.

I'd expect that by using compression you have increased memory use as this
amount of data is far smaller than code to decompress it.

Barry



More information about the Python-list mailing list