Daniel Lemire's blog

, 1 min read

Efficient FIFO/Queue data structure in Python

2 thoughts on “Efficient FIFO/Queue data structure in Python”

  1. b says:

    Weird, I got the following numbers:

    >>> execfile(‘de.py’)

    8.79299998283

    7.91100001335

    9.47399997711

    Lists are worse but not that much worse. They might have improved performance of lists, I’m running 2.4.3.

  2. b says:

    I reran the tests with this code and differencese are indeed massive:

    >>> execfile(‘de2.py’)
    “”
    0.911000013351
    “”
    0.790999889374
    “”
    2.06299996376

    Increasing iterations of each loop 10 times:

    >>> execfile(‘de2.py’)
    “”
    8.94199991226
    “”
    8.04200005531
    “”
    136.887000084