[Python-Dev] Re: FIFO data structure? (original) (raw)

Jeremy Fincher fincher.8@osu.edu
Sun, 20 Apr 2003 18:21:02 -0400


-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

On Sunday 20 April 2003 04:54 pm, Guido van Rossum wrote:

Also ask yourself the following questions. How much time are you paying for the overhead of using a class vs. using a list directly?

I imagine the object would eventually be written in C (probably by someone more experienced than myself, but I could do it if need be), when that overhead shouldn't matter. But even with a pure-Python implementation, as noted in my other email, the fastest O(1) implementation outran the naive list implementation (granted it was wrapped in a class to maintain the same interface) somewhere between 100 and 1000 elements. I could find out the average place at which the O(1) implementation becomes faster, if you're interested.

Jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+ox1OqkDiu+Bs+JIRAhvvAJ9gHSRpZmf8F2tCsqK40uSPqIoCMACeM5lY k7FInBxUdA3MF/q/Hl4U45U= =lb0T -----END PGP SIGNATURE-----