On Tue, 28 Jan 2014 11:22:40 +0100
Victor Stinner <victor.stin...@gmail.com> wrote:
> 2014-01-28 "Martin v. Löwis" <mar...@v.loewis.de>:
> > Debugging reveals that it is actually the many integer objects which
> > trigger the sharing code. So a much simplified example of Victor's
> > benchmarking code can use
> >
> > data = [0]*10000000
> >
> > The difference between version 2 and version 3 here is that v2 marshals
> > a lot of "0" integers, whereas version 3 marshals a single one, and then
> > a lot of references to this integer.
> 
> Since the output size looks to be the same, it may be interesting to
> special-case small integers, or even integers and floats in general.
> Handling references to these numbers takes probably more CPU, whereas
> the gain on the file size is probably minor.

Please remember file size is only one factor. Another factor is runtime
size after unmarshalling.

For the typical case of pyc files, dump times are not very important.
Load times are.

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to