]> granicus.if.org Git - python/commit
Tim found that once test_longexp has run, test_sort takes very much
authorGuido van Rossum <guido@python.org>
Thu, 1 Aug 2002 18:50:33 +0000 (18:50 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 1 Aug 2002 18:50:33 +0000 (18:50 +0000)
commitf4be427c46c4508a9c2a14f5fd224ef6721784aa
tree415614077f852aaf31779cda9f2ef060ffa01268
parent0a3d6060d53da872729997807e1f564dbbb8c550
Tim found that once test_longexp has run, test_sort takes very much
longer to run than normal.  A profiler run showed that this was due to
PyFrame_New() taking up an unreasonable amount of time.  A little
thinking showed that this was due to the while loop clearing the space
available for the stack.  The solution is to only clear the local
variables (and cells and free variables), not the space available for
the stack, since anything beyond the stack top is considered to be
garbage anyway.  Also, use memset() instead of a while loop counting
backwards.  This should be a time savings for normal code too!  (By a
probably unmeasurable amount. :-)
Objects/frameobject.c