Title: 544
Tags: lec12

Q: What is the name for a piece of data loaded to CPU cache?
A: cache line

Q: What is the most common cache line size for modern CPUs?
A: 64 bytes is common (other sizes like 128 used to be more common; new Macs haved started using 128 again)

Q: If you want to sum over column in a numpy matrix in a cache friendly way, how should you create the array?
A: First create an array where each column is actually stored as a row in the matrix.  Then transpose it.  This will get you columns that are contiguous in memory, resulting in fewer cache lines being loaded as the data is scanned.

Q: How does PyArrow indicate which strings/ints/etc are null/None in an array?
A: validity bitmap: 1 means valid, 0 means null/None

Q: How can you add a region to your virtual address space that is not backed by a file?
A: anonymous mmap

Q: How can you map a file into your virtual address space?
A: Open the file, get the f.fileno(), and pass it to mmap.

Q: If you want to be able to evict pages in anonymously mmap'd regions, what do you need to do?
A: enable a swap file in Linux