[Patches] [ python-Patches-868736 ] Add GC collection to timeit

SourceForge.net noreply at sourceforge.net
Thu Jan 1 11:17:06 EST 2004


Patches item #868736, was opened at 2004-01-01 03:54
Message generated for change (Comment added) made by gvanrossum
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=868736&group_id=5470

Category: Library (Lib)
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Raymond Hettinger (rhettinger)
>Assigned to: Raymond Hettinger (rhettinger)
Summary: Add GC collection to timeit

Initial Comment:
This patch adds a gc.collect() before each timing.

Since timings are only relevant when compared to other
timings, it makes sense to put them on as equal footing
as possible.  Running a gc.collect() before each timing
provides some assurance that a routine gc collection
won't throw-off one timing while not affecting another.

At worst, this patch does nothing.  At best, it makes
the timings more comparable.

----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2004-01-01 11:17

Message:
Logged In: YES 
user_id=6380

Good idea.

(I don't remember -- is it still possible to build Python
without gc? If it is, the gc import and use should be
conditional. But I vaguely remember it's no longer optional.)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=868736&group_id=5470



More information about the Patches mailing list