Aaron Watters added the comment:

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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>
> <http://bugs.python.org/issue1792>
> __________________________________
>

Added file: http://bugs.python.org/file9124/unnamed

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1792>
__________________________________
Facundo<br><br>1) the +1024 was an accelerator to jump up to over 1k at the 
first resize.&nbsp; I think it&#39;s a good idea or at least doesn&#39;t 
hurt.<br><br>2) Here is an example program:<br><br>def 
test():<br>&nbsp;&nbsp;&nbsp; from marshal import dumps
<br>&nbsp;&nbsp;&nbsp; from time import time<br>&nbsp;&nbsp;&nbsp; testString = 
&quot;abc&quot;*100000000<br>&nbsp;&nbsp;&nbsp; print &quot;now 
testing&quot;<br>&nbsp;&nbsp;&nbsp; now = time()<br>&nbsp;&nbsp;&nbsp; dump = 
dumps(testString)<br>&nbsp;&nbsp;&nbsp; elapsed = 
time()-now<br>&nbsp;&nbsp;&nbsp; print &quot;elapsed&quot;, elapsed
<br><br>if __name__==&quot;__main__&quot;:<br>&nbsp;&nbsp;&nbsp; 
test()<br><br>Here are two runs: the first with the old marshal and the second 
with the patched marshal.&nbsp; The second is <br>better than 2* faster than 
the first.<br><br>arw:/home/arw/test&gt; 
~/apache2/htdocs/pythonsrc/Python/python_old 
mtest1.py<br>now testing<br>elapsed 4.13367795944<br>arw:/home/arw/test&gt; 
~/apache2/htdocs/pythonsrc/Python/python mtest1.py<br>now testing<br>elapsed 
1.7495341301<br>arw:/home/arw/test&gt; <br><br>The example that inspired this 
research was very complicated and involved millions of calls to dumps
<br>which caused a number of anomalies (system calls went berzerk for some 
reason, maybe paging).<br><br>&nbsp;&nbsp; -- Aaron Watters<br><br><div 
class="gmail_quote">On Jan 11, 2008 9:25 AM, Facundo Batista &lt;<a 
href="mailto:[EMAIL PROTECTED]">
[EMAIL PROTECTED]</a>&gt; wrote:<br><blockquote class="gmail_quote" 
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; 
padding-left: 1ex;"><br>Facundo Batista added the comment:<br><br>Why not just 
double the size? The &quot;doubling + 1024&quot; address some
<br>specific issue? If so, it should be commented.<br><br>Also, do you have an 
example of a marshal.dumps() that suffers from this<br>issue?<br><br>Thank 
you!<br><br>----------<br>nosy: +facundobatista<br><div><div></div>
<div class="Wj3C7c"><br>__________________________________<br>Tracker &lt;<a 
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>&gt;<br>&lt;<a 
href="http://bugs.python.org/issue1792"; 
target="_blank">http://bugs.python.org/issue1792
</a>&gt;<br>__________________________________<br></div></div></blockquote></div><br>

_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to