Cache Optimizations

2026-02-07 21:48

Status: #child

Tags: #software #engineering

Cache Optimization

Pasted image 20260207215411.png

Examples of system caching:

Expense of storage

As we discussed in Memory Hierarchy, the battle is between financial feasibility and performance provided by storage devices.

Pasted image 20260207232310.png

Access cost framework

System calls can be a really good example. One can consider the cost of a read(fd, buf, sz) system call.
Assuming that a read roughly obeys the rule stated above, will the cost per request be higher than the cost per unit or vice versa?


More than cost

Other metrics we have considered in Memory Hierarchy are the latency and throughput which are the inverse of each other for some storage technologies.

For example, on a true random access device, the cost framework involves a cost per request of ~0 which makes the cost of accessing N units just be NU.

For other technologies (like SSDs), latency and throughput can diverge!

Optimization strats

Batching

Prefetching

Write coalescing

Parallel or background access

References

Memory Hierarchy

Tags:

Software
Engineering