Performance
Horst Gassner
horst at proceryon.at
Tue Jul 4 03:25:41 EDT 2000
Hi all!
I have implemented a tree view with special items (the base for this
work was the TreeWidget from IDLE).
The performance is not the best and therefore I ran the profiler today.
The following function is one of the slower ones and I would be happy if
there are any possibilties to speed this thing up.
subItems = {}
if s.__subList[level] :
for key in s.__subList[level].keys ():
# root level is special case!
# get all sublevels without recognizing id of sublevel
if level==0 or string.find(key, id) == 0 :
subItems[key] = s.__subList[level][key]
The functions looks for all subitems for a given level and a given id.
For each level I have pre-built a list that I have just to go through
the items of the given level.
Thanx in advance
Horst
More information about the Python-list
mailing list