FAQ
hi all,
I feel lack of native Python lists operations (e.g. taking N greatest
elements with the involved key function and O(n) speed) and
occasionally found blist
http://pypi.python.org/pypi/blist/
Its entry says it is better than Python list. Did anyone ensure?
Will it ever be merged into Python source code?
D.

Search Discussions

  • Daniel Stutzbach at Jul 7, 2011 at 5:03 pm

    On Thu, Jul 7, 2011 at 5:08 AM, dmitrey wrote:

    I feel lack of native Python lists operations (e.g. taking N greatest
    elements with the involved key function and O(n) speed) and
    occasionally found blist
    http://pypi.python.org/pypi/blist/
    Its entry says it is better than Python list. Did anyone ensure?
    It has better performance for many operations. I made a very detailed
    performance comparison here (against Python 3.1):
    http://stutzbachenterprises.com/performance-blist

    Undoubtedly, you can find sequences of operations where Python's built-in
    list type has better performance by a constant factor. Python's built-in
    list type is more memory-efficient for small lists (blist's memory usage for
    small lists could be improved to be similar, but I haven't gotten around to
    making the necessary changes.)

    Will it ever be merged into Python source code?
    Seems unlikely.

    --
    Daniel Stutzbach
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/python-list/attachments/20110707/e04eab38/attachment.html>
  • Miki Tebeka at Jul 7, 2011 at 5:27 pm
  • Raymond Hettinger at Jul 7, 2011 at 10:46 pm

    On Jul 7, 5:08?am, dmitrey wrote:
    hi all,
    I feel lack of native Python lists operations (e.g. taking N greatest
    elements with the involved key function and O(n) speed)
    Take a look at heapq.nlargest()...

    and
    occasionally found blisthttp://pypi.python.org/pypi/blist/
    Its entry says it is better than Python list.
    It should say: better in some respects and worse in others

    Do you honestly think that python's list implementation
    as a simple array of pointers can be beaten in every
    category of performance?

    Did anyone ensure?
    Will it ever be merged into Python source code?
    It was rejected as a replacement for the existing list implementation.
    There is some chance it will get accepted into the collections module
    someday.


    Raymond

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJul 7, '11 at 12:08p
activeJul 7, '11 at 10:46p
posts4
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase