Skip to content

CS & Compilers

Compilers

General Resources

Algorithms for modern hardware is an amazing online book on algorithms and data structures from the view point of modern architectures. It's one of few texts I've found which actually goes into detail about how to design algorithms with respect to memory hierarchies, modern compilers.

Algorithms for Competitive Programming

The Design of Approximation Algorithms

Streaming Algorithgms

Data Structures

Hash Tables

Articles and Blog Posts

A series of posts by Malte Skarupke on different Hash Table implementations. He also held a talk at c++now 2018 (see link below)

Videos

Books

Unfortunately I've read many books which takes very theoretical approach to the subject, but that doesn't help when one wants to implement a good Hash Table (and this is coming from a pure mathematician!).

Memory Management

Memory Allocators

Articles and Blog Posts

There are a lot of good material in this are by Emery Berger Professor at UMass Amherst I'd recommend looking at his personal webpage . I especially recommend the following papers:

The HeapLayer code can be foun on in the github repo emeryberger/Heap-Layers

I would suggest looking at Howard Hinnants short_alloc.h and also his Allocator Boilerplate page which contains the skeleton for a C++11 standard compliant allocator. Note! However that C++17 allocator reduces this even further.

Article series on the website gingerBill. Nice articles covering the most commonly used allocation strategies, code in C.

Videos

Books 📚

There are many books that mention custom allocators, however only a few actually do more than just scratch the surface. Here are three books which treats allocators somewhat in depth.

  • Chapter 7 of The Garbage Garbage Collection Handbook 📖 treats allocators and allocation strategies and provides plenty of algorithms in pseudocode and additional references.

  • Chapter 6 of Game Engine Architecture 📖 also goes through

  • Chapter 4 of Modern C++ Design 📖 builds a custom allocator in C++. NOTE: Andrei prefers another approach to compose custom allocators as in Heap Layer this is mentioned in the Policy Design ... paper. However the specific ideas for how to write a small object allocator are still valid.

TSP

Helsgaun's website

TSP blog

TSPLIB