ORMs are Killing Your Performance
summary
ORMs load entire result sets into objects, creating a memory reservoir and increasing latency and CPU cycles (about 1.5× in his example), promoting short-lived allocations into old GC generations and causing noticeable GC pauses and cache misses. Instead, stream records as key-value pairs and perform all transforms while each row is hot in L1 cache. A single SQL query can render a nested dynamic form by pivoting parent/child rows; careless parameter binding forces bad plans on partitioned tables. Convergence implements this streaming, config-driven approach and cuts boilerplate (Pet Clinic: 2,256→525 LOC).
AI-written summary · about
chapters (9)
- 0:00Introduction and the Hidden Costs of ORMs
- 2:00How ORMs Increase Latency and Memory Use
- 4:19Garbage Collection Pauses and CPU Cache Misses
- 7:44The Fix: Stream Records as Key-Value Pairs
- 11:20Why Streaming Objects Is Not Enough
- 13:28Building a Dynamic Form with One SQL Query
- 19:42The Query Parameterization Performance Trap
- 24:24A Configuration-Driven Alternative to ORMs
- 28:22Q&A: Gradually Replacing an ORM
