cpython/Modules
Tim Peters 8839617cc9 SF bug #574132: Major GC related performance regression
"The regression" is actually due to that 2.2.1 had a bug that prevented
the regression (which isn't a regression at all) from showing up.  "The
regression" is actually a glitch in cyclic gc that's been there forever.

As the generation being collected is analyzed, objects that can't be
collected (because, e.g., we find they're externally referenced, or
are in an unreachable cycle but have a __del__ method) are moved out
of the list of candidates.  A tricksy scheme uses negative values of
gc_refs to mark such objects as being moved.  However, the exact
negative value set at the start may become "more negative" over time
for objects not in the generation being collected, and the scheme was
checking for an exact match on the negative value originally assigned.
As a result, objects in generations older than the one being collected
could get scanned too, and yanked back into a younger generation.  Doing
so doesn't lead to an error, but doesn't do any good, and can burn an
unbounded amount of time doing useless work.

A test case is simple (thanks to Kevin Jacobs for finding it!):

x = []
for i in xrange(200000):
    x.append((1,))

Without the patch, this ends up scanning all of x on every gen0 collection,
scans all of x twice on every gen1 collection, and x gets yanked back into
gen1 on every gen0 collection.  With the patch, once x gets to gen2, it's
never scanned again until another gen2 collection, and stays in gen2.

Bugfix candidate, although the code has changed enough that I think I'll
need to port it by hand.  2.2.1 also has a different bug that causes
bound method objects not to get tracked at all (so the test case doesn't
burn absurd amounts of time in 2.2.1, but *should* <wink>).
2002-06-30 17:56:40 +00:00
..
expat Patch #551011: Fix compilation problems with Cygwin. 2002-05-08 07:16:37 +00:00
.cvsignore Add Setup.config 2000-06-30 16:09:01 +00:00
_codecsmodule.c Patch #569753: Remove support for WIN16. 2002-06-30 15:26:10 +00:00
_curses_panel.c Fix whitespace 2002-03-31 14:55:17 +00:00
_cursesmodule.c I think this fixes 2002-01-30 15:39:28 +00:00
_hotshot.c Patch #569753: Remove support for WIN16. 2002-06-30 15:26:10 +00:00
_localemodule.c Patch #569753: Remove support for WIN16. 2002-06-30 15:26:10 +00:00
_sre.c SF #561244 Micro optimizations 2002-06-13 21:11:11 +00:00
_ssl.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
_testcapimodule.c Switch to using METH_NOARGS where possible. 2002-04-01 14:28:58 +00:00
_tkinter.c Fix SF bug #557436, TclError is a str should be an Exception 2002-06-04 17:14:07 +00:00
_weakref.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
addrinfo.h Undefine addrinfo.h constants if the system header defined them. 2001-12-06 19:04:35 +00:00
almodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
ar_beos Moved BeOS/ar-fake and BeOS/linkmodule to Modules/ar_beos and 2001-02-16 03:24:50 +00:00
arraymodule.c Fix the bug described in 2002-06-19 15:44:15 +00:00
audioop.c Patch #477750: Use METH_ constants in Modules. 2002-01-17 23:15:58 +00:00
binascii.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
bsddbmodule.c SF patch [ 545523 ] patch for 514433 bsddb.dbopen (NULL) 2002-04-23 02:11:05 +00:00
ccpython.cc
cdmodule.c Repair widespread misuse of _PyString_Resize. Since it's clear people 2002-04-27 18:44:32 +00:00
cgen.py Convert a pile of obvious "yes/no" functions to return bool. 2002-04-04 22:55:58 +00:00
cgensupport.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
cgensupport.h REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
clmodule.c Repair widespread misuse of _PyString_Resize. Since it's clear people 2002-04-27 18:44:32 +00:00
cmathmodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
config.c.in gcmodule is now enabled here 2001-08-30 00:12:32 +00:00
cPickle.c Undefine TRUE and FALSE before redefining them. 2002-06-26 20:40:42 +00:00
cryptmodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
cStringIO.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
cstubs REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
dbmmodule.c This introduces stricter library/header file checking for the Berkeley DB 2002-06-14 20:30:31 +00:00
dlmodule.c Convert METH_OLDARGS -> METH_VARARGS: also PyArg_Parse -> PyArg_ParseTuple 2002-03-31 15:43:28 +00:00
errnomodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
fcntlmodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
flmodule.c Convert METH_OLDARGS -> METH_NOARGS: remove args parameter 2002-03-31 15:56:56 +00:00
fmmodule.c Convert from using METH_OLDARGS to METH_NOARGS. 2002-03-31 14:57:24 +00:00
fpectlmodule.c Got rid of a few more NeXT ifdefs. The last, I think. 2002-02-01 15:46:29 +00:00
fpetestmodule.c Patch #477750: Use METH_ constants in Modules. 2002-01-17 23:15:58 +00:00
gcmodule.c SF bug #574132: Major GC related performance regression 2002-06-30 17:56:40 +00:00
gdbmmodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
getaddrinfo.c Remove INET6 define. Use ENABLE_IPV6 instead. 2001-12-02 10:15:37 +00:00
getbuildinfo.c More sprintf -> PyOS_snprintf. 2001-12-04 01:11:32 +00:00
getnameinfo.c Remove INET6 define. Use ENABLE_IPV6 instead. 2001-12-02 10:15:37 +00:00
getpath.c Include <unistd.h> in Python.h. Fixes #500924. 2002-01-12 11:05:12 +00:00
glmodule.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
grpmodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
imageop.c Convert more METH_OLDARGS & PyArg_Parse() 2002-04-02 18:26:33 +00:00
imgfile.c Convert METH_OLDARGS -> METH_VARARGS: also PyArg_Parse -> PyArg_ParseTuple 2002-03-31 15:43:28 +00:00
ld_so_aix
ld_so_beos Remove a hard coded Python version, and a now incorrect relative path. Closes 2001-02-16 03:27:35 +00:00
license.terms
linuxaudiodev.c Repair widespread misuse of _PyString_Resize. Since it's clear people 2002-04-27 18:44:32 +00:00
main.c OS/2 EMX port changes (Modules part of patch #450267): 2002-03-03 02:59:16 +00:00
makesetup [Patch #536769] Add -Xcompiler flag for adding arguments and switches for 2002-03-29 18:00:19 +00:00
makexp_aix
mathmodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
md5.h Issue an explicit error when we can't find an appropriate type for 2002-05-29 14:00:22 +00:00
md5c.c Patch #463421: speed up md5 module with real memcpy/set. 2001-09-24 17:14:40 +00:00
md5module.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
mmapmodule.c Patch #569753: Remove support for WIN16. 2002-06-30 15:26:10 +00:00
mpzmodule.c Get rid of all METH_OLDARGS & PyArg_Parse. 2002-04-01 01:37:14 +00:00
nismodule.c Remove METH_OLDARGS: 2002-03-31 15:27:00 +00:00
operator.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
parsermodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
pcre-int.h
pcre.h Jack Jansen: Mac Carbon: don't include sys/types if we don't have it 2000-06-28 20:56:30 +00:00
pcremodule.c Patch #477750: Use METH_ constants in Modules. 2002-01-17 23:15:58 +00:00
posixmodule.c Patch #569753: Remove support for WIN16. 2002-06-30 15:26:10 +00:00
puremodule.c Patch #477750: Use METH_ constants in Modules. 2002-01-17 23:15:58 +00:00
pwdmodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
pyexpat.c Define PyDoc_STRVAR if it is not available (PyXML 1.54). 2002-06-30 06:40:55 +00:00
pypcre.c Undefine DPRINTF before defining it, there was a conflict with some other 2002-06-26 20:41:30 +00:00
python.c Even more ANSIfication: fix as many function pointers and declarations as 2000-07-22 23:57:55 +00:00
readline.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
regexmodule.c Repair widespread misuse of _PyString_Resize. Since it's clear people 2002-04-27 18:44:32 +00:00
regexpr.c Python.h: Don't attempt to redefine NDEBUG if it's already defined. 2001-07-15 18:38:47 +00:00
regexpr.h Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in either 2000-07-16 12:04:32 +00:00
resource.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
rgbimgmodule.c Remove METH_OLDARGS: 2002-03-31 15:27:00 +00:00
rotormodule.c Don't accept null bytes in the key. 2002-06-10 19:46:18 +00:00
selectmodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
Setup.config.in gcmodule is now always compiled 2001-08-30 00:13:38 +00:00
Setup.dist SF patch 568629 by Oren Tirosh: types made callable. 2002-06-14 20:41:17 +00:00
sgimodule.c Convert more METH_OLDARGS & PyArg_Parse() 2002-04-02 18:26:33 +00:00
shamodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
signalmodule.c Patch #569753: Remove support for WIN16. 2002-06-30 15:26:10 +00:00
socketmodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
socketmodule.h Major overhaul of timeout sockets: 2002-06-13 15:07:44 +00:00
sre.h Remove extraneous #define as per effbot's instructions in: 2002-03-18 18:46:14 +00:00
sre_constants.h added martin's BIGCHARSET patch to SRE 2.1.1. martin reports 2x 2001-07-02 16:58:38 +00:00
stropmodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
structmodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
sunaudiodev.c Remove METH_OLDARGS: 2002-03-31 15:27:00 +00:00
svmodule.c Patch #477750: Use METH_ constants in Modules. 2002-01-17 23:15:58 +00:00
symtablemodule.c Fix [ #489673 ] memory leak in test_symtable: Free the st_future slot. 2001-12-06 14:34:58 +00:00
syslogmodule.c Use the PyModule_Add*() APIs instead of manipulating the module dict 2002-04-01 14:53:37 +00:00
tclNotify.c Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)', 2000-07-21 06:00:07 +00:00
termios.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
testcapi_long.h Fix error in comment, and in test_long_api and test_longlong_api remove 2001-06-16 08:10:13 +00:00
threadmodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
timemodule.c Patch #569753: Remove support for WIN16. 2002-06-30 15:26:10 +00:00
timing.h
timingmodule.c Convert from using METH_OLDARGS to METH_NOARGS. 2002-03-31 14:57:24 +00:00
tkappinit.c Mods by Tony Lownds (patch 490100, slightly massaged by me) to make Tkinter 2001-12-09 23:15:56 +00:00
unicodedata.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
unicodedata_db.h compress unicode decomposition tables (this saves another 55k) 2001-01-21 22:41:08 +00:00
unicodename_db.h compress unicode decomposition tables (this saves another 55k) 2001-01-21 22:41:08 +00:00
xreadlinesmodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
xxmodule.c Whitespace normalization. 2002-05-23 15:49:38 +00:00
xxsubtype.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00
yuv.h REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
yuvconvert.c REMOVED all CWI, CNRI and BeOpen copyright markings. 2000-09-01 23:29:29 +00:00
zlibmodule.c Patch #568124: Add doc string macros. 2002-06-13 20:33:02 +00:00