Skip to content
Opensource internals
  • Posts

Performance

PostgreSQL Allocates Memory Fast: Size Classes, Freelists, and Context Recycling

Sep 19, 2026 40 min read Jay Hubbert

palloc quantises sizes to powers of two, keeps eleven freelists, carves dying blocks into reusable chunks, and recycles memory contexts so a per-tuple context costs zero mallocs.

PostgresPerformanceMemoryInternals

Read more →

PostgreSQL Groups Commits: How a Hundred Backends Share One fsync

Sep 12, 2026 50 min read Jay Hubbert

Committing doesn’t fsync: backends copy WAL into shared memory and piggyback on one fsync, using LWLockAcquireOrWait so followers can observe someone else’s flush without ever …

PostgresPerformanceWalInternals

Read more →

tmux Batches Terminal Output: One Write() Per Event Loop Iteration

Sep 5, 2026 10 min read Jay Hubbert

Every byte tmux sends to a terminal goes through one function that appends to a per-client buffer, and that buffer is flushed with a single write() per event loop iteration.

TmuxPerformanceInternalsTty

Read more →

PostgreSQL Computes Page Checksums Fast: Thirty-Two Parallel FNV-1a Hashes

Sep 5, 2026 29 min read Jay Hubbert

The page checksum runs 32 FNV-1a hashes in parallel over a 32-column view of the page to hide multiply latency — and 32 is baked into the on-disk format.

PostgresPerformanceStorageInternals

Read more →

PostgreSQL Deduplicates B-Tree Entries: Posting Lists and In-Place Splits

Sep 1, 2026 46 min read Jay Hubbert

B-tree leaves store one posting list tuple per distinct key instead of one entry per row, and an over-long list is split in place inside the insert’s critical section.

PostgresPerformanceBtreeIndexInternals

Read more →

← Newer Page 14 of 17 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·