liveBook · Manning

Memory hierarchy

As explained in Fast Python: High performance techniques for large datasets

A memory hierarchy is an arrangement of storage levels with differing capacities, access speeds, latencies, costs, or persistence.

Memory hierarchy spans CPU caches, RAM, hard disks, local networks, and wide area networks. Understanding these levels helps explain why data representation and processing choices can change performance. section 6.0

Cache-aware processing can make compressed data useful beyond saving storage space: some compressed array representations can be accessed about as quickly as uncompressed ones. Hardware affects the results, so performance comparisons may differ across machines. section 6.0 section 6.2.4

Bit-shuffling array data

For sequential values such as 3, 4, 5, and 6, rearranging bits can expose regular patterns to a compressor. In one comparison, the shuffled representation used 4,600,034 bytes versus 5,345,500 bytes, while taking 596 ms instead of 524 ms. section 6.2.4

How Fast Python: High performance techniques for large datasets covers it

How deep it goes
Connects cache-aware array processing to storage and network levels, while keeping the architecture treatment selective.
Examples
Compares shuffled and unprocessed array representations by storage size and elapsed time.
What you can do after
Apply Blosc’s shuffle option to trade smaller representations against slightly longer processing time.
How it connects
Relates CPU caches, RAM, hard disks, local networks, wide area networks, data compression, and NumExpr.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fast Python: High performance techniques for large datasets. The section links point to the parts of the book it draws on.