Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Memory management Remove topic Memory management Clear all 5 posts RSS

2023

2022

Optimizing Ruby’s Memory Layout: Variable Width Allocation

Deep dive 13 min +130 XP

Ruby 3.2's Variable Width Allocation replaces CRuby's single 40-byte RVALUE slot with five size pools (40, 80, 160, 320 and 640 bytes) so classes, strings, arrays and objects can store their data adjacent to the object instead of in separate malloc'd memory.

Apollo Cache is Your Friend, If You Get To Know It

Deep dive 15 min +150 XP

Apollo Client's InMemoryCache stores a normalized, in-session representation of GraphQL data, and its object lifecycle runs through four stages: fetching (governed by fetch policies, defaulting to cache-first), normalization (splitting responses into objects keyed by __typename plus id or custom keyFields into a flat hash map), updating and merging, and garbage collection and eviction.

The quest for software engineering knowledge.

Look:
Layout: