Python blist

Posted by Jeffye | 8:18 PM

blist 1.3.4

a list-like type with better asymptotic performance and similar performance on small lists

The blist is a drop-in replacement for the Python list the provides better performance when modifying large lists. The blist package also Provides sortedlistsortedsetweaksortedlist,weaksortedsetsorteddict, and btuple types.

Full documentation is at the link below:


Python's built-in list is a dynamically-sized array; to insert or removal an item from the beginning or middle of the list, it has to move most of the list in memory, i.e., O(n) operations. The blist uses a flexible, hybrid array/tree structure and only needs to move a small portion of items in memory, specifically using O(log n) operations.


For small lists, the blist and the built-in list have virtually identical performance

0 comments

Popular Posts

无觅相关文章插件,迅速提升网站流量