On Fri, 25 Jul 2008 09:22:06 -0600, Matthew Fitzgibbons wrote: > As for different data structures, it largely depends on how you need to > access the data. If you don't need to index the data, just loop through > it, you might try a linked list. The performance hit in (2) is coming > from the list del; using a linked list would make the removal constant > rather than O(n), and may even execute faster than (3) as well. > > -Matt
Yes, this was my first inclination. So my question, as alluded to in my original post, is whether there are C compiled modules for linked lists, doubly linked lists, ordered lists ... (the standard data structures) somewhere, to get the extra performance out of them. With python we have all built up creative ways of using the native structures for efficiency reasons. This project was the first time (due to its extreme use of resources) that I've had to worry about these minute considerations of native vs new structure but also take into account native vs python level construct vs compiled module. [P.S. The linked list does compare well with (3) as expected.] -- http://mail.python.org/mailman/listinfo/python-list