The timeit code disables the garbage collector while running. I ran
the tests on my system after adding the following lines to t1() and
t2().
del base
gc.collect()
Original timetest.py:
Using proxy
100 loops, best of 3: 4.45 msec per loop
Call to dummy proxy
100 loops, best of 3: 2.24
John Nagle wrote:
> "weakref.proxy()" probably should work that way.
> Weakref proxies are supposed to be transparent, but they're not
> quite transparent enough.
Submit a patch to SourceForge. Please don't use tabs in email/usenet
postings - use 4-space indents. "return" is not a function, a
John Nagle wrote:
> Are weak refs slower than strong refs? I've been considering making the
> "parent" links in BeautifulSoup into weak refs, so the trees will release
> immediately when they're no longer needed. In general, all links back
> towards the root of a tree should be weak refs; this