[issue22448] call_at/call_later with Timer cancellation can result in (practically) unbounded memory usage.

Yury Selivanov report at bugs.python.org
Tue Sep 30 19:08:24 CEST 2014


Yury Selivanov added the comment:

Victor,

Here's an updated benchmark results:

    NUMBER_OF_TASKS 10000
    ITERATIONS -> 2000 out of 2000
    2 loops:  0.004267875499863294
    1 loop:   0.007916624497738667
    TOTAL_BENCH_TIME 15.975227117538452

    NUMBER_OF_TASKS 100000
    ITERATIONS -> 2000 out of 2000
    2 loops:  0.04882345050100412
    1 loop:   0.09141454550081107
    TOTAL_BENCH_TIME 180.64003109931946

2 loops is always about 30-40% slower.  I've updated the benchmark I used: https://gist.github.com/1st1/b38ac6785cb01a679722 

Now it incorporates a call to heapify, and should yield more stable results. Please check it out, as I'm maybe doing something wrong there, but if it's alright, I think that you need to revert your commits.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22448>
_______________________________________


More information about the Python-bugs-list mailing list