Quantcast
Channel: Top-rated recipes
Viewing all articles
Browse latest Browse all 20

Proof-of-concept for a more space-efficient, faster-looping dictionary (Python)

$
0
0

Python recipe 578375 by Raymond Hettinger (compact, dictionary). Revision 20.

Save space and improve iteration speed by moving the hash/key/value entries to a densely packed array keeping only a sparse array of indices. This eliminates wasted space without requiring any algorithmic changes.


Viewing all articles
Browse latest Browse all 20

Trending Articles