Guido van Rossum [Fri, 24 Jan 1997 03:43:35 +0000 (03:43 +0000)]
Instead of emitting SET_LINENO instructions, generate a line number
table which is incorporated in the code object. This way, the runtime
overhead to keep track of line numbers is only incurred when an
exception has to be reported.
Guido van Rossum [Thu, 23 Jan 1997 23:29:44 +0000 (23:29 +0000)]
Initialize the ob_type field of PyAST_Type dynamically (in
initparser()) instead of statically (in the initializer). The static
initialization, using the address of an object in a different DLL, is
too much for the Microsoft VC++ compiler, and we want to be able to
build this module as a separate DLL (it's nice to have but we don't
want to increase the core DLL's size by 25K). This same trick has
been applied to a number of modules, e.g. NumPy and _tkinter.
Guido van Rossum [Thu, 23 Jan 1997 19:39:29 +0000 (19:39 +0000)]
Forget keeping track of whether a dictionary contains all interned
string keys. Just doing a pointer compare before the string compare
(in fact before the hash compare!) is just as fast.
Guido van Rossum [Wed, 22 Jan 1997 21:00:32 +0000 (21:00 +0000)]
Various notes added:
- -mt option for Solaris threads with Solaris compiler
- make clean when switching static link status for Linux
- DEC alpha --with-dec-threads option
- SunOS removed unnecessary warnings, mention -Xa for SunPro
- Setup.local file
- warn to try make clean after changing readline option
- mention --with-threads as alias for --with-thread
Guido van Rossum [Tue, 21 Jan 1997 21:18:36 +0000 (21:18 +0000)]
Kill all local variables on function return. This closes a gigantic
leak of memory and file descriptors (thanks for Roj for reporting
that!). Alas, the speed goes down by 5%. :-(
Guido van Rossum [Tue, 21 Jan 1997 06:15:24 +0000 (06:15 +0000)]
Only call sigcheck() at the ticker code if we don't have true signals.
This is safe now that both intrcheck() and signalmodule.c schedule a
sigcheck() call via Py_AddPendingCall().
This gives another 7% speedup (never run such a test twice ;-).
Guido van Rossum [Tue, 21 Jan 1997 06:13:09 +0000 (06:13 +0000)]
Arrange for PyErr_CheckSignals() to be called via Py_AddPendingCall().
This avoids having to call sigcheck() (the same routine by its old
name :-) in the ticker code in ceval.c's main interpreter loop.
Guido van Rossum [Tue, 21 Jan 1997 06:00:33 +0000 (06:00 +0000)]
In the Unix version, arrange for sigcheck() to be called via
Py_AddPendingCall(). This avoids having to call sigcheck() in the
ticker code in ceval.c's main interpreter loop.
Guido van Rossum [Mon, 20 Jan 1997 04:20:52 +0000 (04:20 +0000)]
Changes that appear to give another 12% speedup.
Rather than allocating a list object for the fast locals and another
(extensible one) for the value stack and allocating the block stack
dynamically, allocate the block stack with a fixed size (CO_MAXBLOCKS
from compile.h), and stick the locals and value stack at the end of
the object (this is now possible since the stack size is known
beforehand). Get rid of the owner field and the nvalues argument --
it is available in the code object, like nlocals.
Guido van Rossum [Sat, 18 Jan 1997 08:02:57 +0000 (08:02 +0000)]
Intern all names and varnames in newcodeobject(), plus those string
literals that look like identifiers. Also intern all strings used as
names during the compilation.
Guido van Rossum [Sat, 18 Jan 1997 07:53:23 +0000 (07:53 +0000)]
Two speedup hacks. Caching the hash saves recalculation of a string's
hash value. Interning strings (which requires hash caching) tries to
ensure that only one string object with a given value exists, so
equality tests are one pointer comparison. Together, these can speed
the interpreter up by as much as 20%. Each costs the size of a long
or pointer per string object. In addition, interned strings live
until the end of times. If you are concerned about memory footprint,
simply comment the #define out here (and rebuild everything!).
Guido van Rossum [Fri, 17 Jan 1997 21:04:03 +0000 (21:04 +0000)]
Add co_stacksize field to codeobject structure, and stacksize argument
to PyCode_New() argument list. Move MAXBLOCKS constant to conpile.h.
Added accurate calculation of the actual stack size needed by the
generated code.
Also commented out all fprintf statements (except for a new one to
diagnose stack underflow, and one in #ifdef'ed out code), and added
some new TO DO suggestions (now that the stacksize is taken of the TO
DO list).
Guido van Rossum [Fri, 17 Jan 1997 20:59:26 +0000 (20:59 +0000)]
Add co_stacksize field to codeobject structure, and stacksize argument
to PyCode_New() argument list. Also add CO_MAXBLOCKS constant
indicating the maximum static nesting supported by the compiler.
Barry Warsaw [Fri, 17 Jan 1997 00:01:33 +0000 (00:01 +0000)]
(puremodule.c): New module which exports the Purify and Quantify C API
to Python. Minimal documentation is included in comments at the top
of the file, and in the Misc/PURIFY.README file. Note that this
module must be statically linked since Pure doesn't provide shared
stubs libraries.
(Setup.in): Added commented template for pure module
(syslogmodule.c): ins() function wasn't declared static.
Roger E. Masse [Thu, 16 Jan 1997 16:51:57 +0000 (16:51 +0000)]
As per GvR recomendations, remove the restriction that binhex only run on
big-endian machines. This is done by directing the struct module's pack
and unpack methods to treat the data always in bin endian format.
This has been tested on irix (big endian) and solaris x86 (little endian)
but not yet on the mac.
Barry Warsaw [Thu, 16 Jan 1997 16:49:44 +0000 (16:49 +0000)]
set_key(): Use Py_CHARMASK macro to get the character from the array
unsigned. This fixes the 8bit-char-in-key platform incompatibility.
I also removed the old backwards compatibility code, and the commented
lisp rotor code. I retained the lisp docstrings as comments preceding
each function.
Roger E. Masse [Wed, 15 Jan 1997 20:07:07 +0000 (20:07 +0000)]
Modified to use 'rgbimg' instead of the SGI specific 'imgfile' for reading
the imagefiles and converting tham to a format suitable for imageop. Also
added two more tests 'rgb2rgb8' and 'rgb82rgb' which remove the dependence
on the file 'greytest.rgb'.
Barry Warsaw [Tue, 14 Jan 1997 17:45:08 +0000 (17:45 +0000)]
Eliminated gcc -Wall complaints:
- Quieted gcc -Wall by removing unused local variables.
- Added some choice parentheses around assignments in conditional
tests.
- Removed an unused (and seemingly unreachable) err label in
load_short_binstring().
- in Unpickler_load(), removed \. in string format.
- init_stuff() was declared to return an int, but had these
problems:
- it was returning NULL instead of 0 or 1 in some cases
- it was falling of the end of the routine without returning
anything
- the call of init_stuff() in initcPickle() was never checking
the return value anyway.
I changed all this by returning 1 in the case of errors, 0 when
no error occurred. Then in initcPickle(), if init_stuff()
returns non-zero, I call Py_FatalError().
Suppressing my urge to reformat according to Python coding standards!
:-)