Skip to main content

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

Project description

The BList is a type that looks, acts, and quacks like a Python list, but has better performance for for modifying large lists.

For small lists (fewer than 128 elements), BLists and the built-in list have very similar performance, although BLists are memory inefficient if you need to create a larger number of small lists.

Here are some of the use cases where the BLists is dramatically faster than the built-in list:

  1. Insertion into or removal from a large list (O(log n) vs. O(n))

  2. Taking large slices of large lists (O(log n) vs O(n))

  3. Making shallow copies of large lists (O(1) vs. O(n))

  4. Changing large slices of large lists (O(log n + log k) vs. O(n + k))

  5. Multiplying a list to make a large, sparse list (O(log k) vs. O(kn))

You’ve probably noticed that we keep referring to “large lists”.

So you can see the performance of the BList in more detail, several performance graphs available at the following link: http://stutzbachenterprises.com/blist/

Example usage:

>>> from blist import *
>>> x = blist([0])             # x is a BList with one element
>>> x *= 2**29                 # x is a BList with > 500 million elements
>>> x.append(5)                # append to x
>>> y = x[4:-234234]           # Take a 500 million element slice from x
>>> del x[3:1024]              # Delete a few thousand elements from x

For comparison, on most systems the built-in list just raises MemoryError and calls it a day.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blist-1.0.1.tar.gz (95.1 kB view details)

Uploaded Source

Built Distributions

blist-1.0.1.win32-py3.1.exe (223.0 kB view details)

Uploaded Source

blist-1.0.1.win32-py3.0.exe (223.0 kB view details)

Uploaded Source

blist-1.0.1.win32-py2.6.exe (94.1 kB view details)

Uploaded Source

blist-1.0.1-py2.6-win32.egg (26.3 kB view details)

Uploaded Egg

blist-1.0.1-py2.6-linux-i686.egg (94.1 kB view details)

Uploaded Egg

blist-1.0.1-py2.5-linux-i686.egg (93.7 kB view details)

Uploaded Egg

blist-1.0.1-py2.5-cygwin-1.5.25-i686.egg (97.4 kB view details)

Uploaded Egg

File details

Details for the file blist-1.0.1.tar.gz.

File metadata

  • Download URL: blist-1.0.1.tar.gz
  • Upload date:
  • Size: 95.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for blist-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7fab977948fcb5bc8be7567402ed28559879014379bd9fa9254f125df77f1858
MD5 ff160b71f23d6730b743e84869f5d6fa
BLAKE2b-256 2b909b16cfeb01b67dfc54a1f72fb895c4b24617ee1751cc83ce32387b3c4a9d

See more details on using hashes here.

File details

Details for the file blist-1.0.1.win32-py3.1.exe.

File metadata

  • Download URL: blist-1.0.1.win32-py3.1.exe
  • Upload date:
  • Size: 223.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for blist-1.0.1.win32-py3.1.exe
Algorithm Hash digest
SHA256 5c697af589092325b977cae2823bd5bd7e2d75f7d183c4e80055bd7ea0ec2de4
MD5 7a68e9dcd4bdc9204d8804f5c248a7ff
BLAKE2b-256 0de8878246a7dcf50b002857143fe6d56d8a934e4c32d7d6a5276af4a2682fcf

See more details on using hashes here.

File details

Details for the file blist-1.0.1.win32-py3.0.exe.

File metadata

File hashes

Hashes for blist-1.0.1.win32-py3.0.exe
Algorithm Hash digest
SHA256 0044a4acb99f6a14066c8b5c84961795878d4abf476df7cf98a0cf57cd55027e
MD5 1678c1ccb78ef7a5837e638604f71313
BLAKE2b-256 713b44617d0edf6b8b7702cb83318f827f438acc6b88765edeb21516cd98d7b9

See more details on using hashes here.

File details

Details for the file blist-1.0.1.win32-py2.6.exe.

File metadata

File hashes

Hashes for blist-1.0.1.win32-py2.6.exe
Algorithm Hash digest
SHA256 86aabc12e1a22d11993ed2cd2e0fbf145171f302342f40072ab5a08b3761fd62
MD5 e0c6d76d7944edaa2bd1b17624a1726a
BLAKE2b-256 381bbb6b7a83d5866d833ebd711ef93db169681c60b1cd13bab329da7b2222a6

See more details on using hashes here.

File details

Details for the file blist-1.0.1-py2.6-win32.egg.

File metadata

File hashes

Hashes for blist-1.0.1-py2.6-win32.egg
Algorithm Hash digest
SHA256 dbc0244aeb134b85eb93756120a8b459611ac3fce0d25fa4938d80e9708d49ca
MD5 9694ff76549cb06485221f2910984dc0
BLAKE2b-256 197c7db77e503c9d3c88a854ca462b4a87366ae275b6c6de46c8572256f7facd

See more details on using hashes here.

File details

Details for the file blist-1.0.1-py2.6-linux-i686.egg.

File metadata

File hashes

Hashes for blist-1.0.1-py2.6-linux-i686.egg
Algorithm Hash digest
SHA256 4eb1904940a1f8cf3ae504d2315c5e9e13bfff7c0d0d5fe7dd75d2c1947dbe28
MD5 b26a1c2ddb4c98cdf9faa4aa7d1b0c8c
BLAKE2b-256 1230a8761f52769669756a472f59d57fc2f86929a558c7624276a6771a9bf2f2

See more details on using hashes here.

File details

Details for the file blist-1.0.1-py2.5-linux-i686.egg.

File metadata

File hashes

Hashes for blist-1.0.1-py2.5-linux-i686.egg
Algorithm Hash digest
SHA256 d90b919807a5613806fd790f4a6617be58f8a902f15b05f95530c5f2a8e2bec9
MD5 11ca97886e621c3f048f8525a6fb2d08
BLAKE2b-256 70a106a8b6cbfeccf098b8878615869e9ef92ca271a4608c72af35f6eb0b6c24

See more details on using hashes here.

File details

Details for the file blist-1.0.1-py2.5-cygwin-1.5.25-i686.egg.

File metadata

File hashes

Hashes for blist-1.0.1-py2.5-cygwin-1.5.25-i686.egg
Algorithm Hash digest
SHA256 4ff3ade181b2d69f708a8ea42d5b5412e29433ddbd2b7db3e8f6bb0a4acadb4e
MD5 da065c8c1ff480ac8dd46dc151bb75de
BLAKE2b-256 e2b7d7ee8756643e66e1000ef46129a9080ad1bf604516d93de6c6a0c8d7e006

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page