E&S CVS Commit: PyProtocols - Encapsulate index structures for criteria, saving both space and time. The
pje at eby-sarna.com
pje at eby-sarna.com
Sun Jan 30 21:48:00 EST 2005
Module Name: PyProtocols
Committed By: pje
Date: Mon Jan 31 02:47:59 UTC 2005
Modified Files:
PyProtocols/src/dispatch: functions.py
Log Message:
Encapsulate index structures for criteria, saving both space and time. The
old data structure used memory for every test expression, for every case,
even if that particular case didn't test that expression. The new data
structure is now maximally sparse, and doesn't need space for a case that
doesn't test a given expression. Also, its dimensions are rearranged in
a way that means the process of determining the "best" dispatch should now
make dramatically fewer hash lookups and temporary memory allocations.
For example, it now only creates the "best" dispatch map, not each
intermediate dispatch map. (This wasn't possible before because of the
way the index dimensions were arranged.) None of this will speed up
the common cases for dispatching, but it should speed up the process of
building or rebuilding the dispatch tree for larger generic functions. The
main purpose of the change, however, was to reduce the N**2 memory
consumption for generic functions with lots of test expressions and lots
of methods.
To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PyProtocols/src/dispatch/functions.py.diff?r1=1.24&r2=1.25
To generate a diff of this commit:
cvs rdiff -r1.24 -r1.25 PyProtocols/src/dispatch/functions.py
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
More information about the source-changes
mailing list