This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author aaron_watters
Recipients aaron_watters, facundobatista
Date 2008-01-11.15:14:58
SpamBayes Score 0.048174463
Marked as misclassified No
Message-id <fc13a6500801110714w8a92e2amebcbf62ba87bb165@mail.gmail.com>
In-reply-to <1200061552.02.0.912767766485.issue1792@psf.upfronthosting.co.za>
Content
Facundo

1) the +1024 was an accelerator to jump up to over 1k at the first resize.
I think it's a good idea or at least doesn't hurt.

2) Here is an example program:

def test():
    from marshal import dumps
    from time import time
    testString = "abc"*100000000
    print "now testing"
    now = time()
    dump = dumps(testString)
    elapsed = time()-now
    print "elapsed", elapsed

if __name__=="__main__":
    test()

Here are two runs: the first with the old marshal and the second with the
patched marshal.  The second is
better than 2* faster than the first.

arw:/home/arw/test> ~/apache2/htdocs/pythonsrc/Python/python_old mtest1.py
now testing
elapsed 4.13367795944
arw:/home/arw/test> ~/apache2/htdocs/pythonsrc/Python/python mtest1.py
now testing
elapsed 1.7495341301
arw:/home/arw/test>

The example that inspired this research was very complicated and involved
millions of calls to dumps
which caused a number of anomalies (system calls went berzerk for some
reason, maybe paging).

   -- Aaron Watters

On Jan 11, 2008 9:25 AM, Facundo Batista <report@bugs.python.org> wrote:

>
> Facundo Batista added the comment:
>
> Why not just double the size? The "doubling + 1024" address some
> specific issue? If so, it should be commented.
>
> Also, do you have an example of a marshal.dumps() that suffers from this
> issue?
>
> Thank you!
>
> ----------
> nosy: +facundobatista
>
> __________________________________
> Tracker <report@bugs.python.org>
> <http://bugs.python.org/issue1792>
> __________________________________
>
Files
File name Uploaded
unnamed aaron_watters, 2008-01-11.15:14:57
History
Date User Action Args
2008-01-11 15:14:59aaron_watterssetspambayes_score: 0.0481745 -> 0.048174463
recipients: + aaron_watters, facundobatista
2008-01-11 15:14:58aaron_watterslinkissue1792 messages
2008-01-11 15:14:58aaron_watterscreate