Performance optimization

Profile-guided Optimization

Use profiles produced by performance monitoring to find hot code and guide the compiler's optimizations

In-memory database

Disk databases are slow mainly because bringing data from disk into memory requires data structure transformations. See the "Keeping everything in memory" section in DDIA

The best-performing serialization implementation

Serializable Snapshot Isolation (SSI), the serialization used by PostgreSQL and FoundationDB uses this implementation

See the "Serializable Snapshot Isolation" section in DDIA

spatial/temporal locality

The example of optimizing matrix multiplication in CSAPP

Optimize the branch predictor

In C there are macros to do this, but performance gains are usually limited

Bind threads to CPUs

Switching threads between CPUs causes L1 and L2 caches to become invalid

Use memcached to reduce Redis HGETALL pressure

Memcached has very good pure KV performance

Asynchronous database writes

Only useful when writes are very slow; otherwise it will further reduce performance

High-performance Go programming

https://geektutu.com/post/high-performance-go.htmlarrow-up-right

Last updated