Go established request ergonomics in backend systems: declare a DTO struct, call json.Unmarshal, append to slices, and return a response. This design incurs runtime costs:
- Passing a struct pointer to
json.Unmarshaltriggers runtime reflection (reflect.Value) and forces request DTOs onto the heap via escape analysis. - Growing slices via
appendallocate on the garbage-collected heap, dispersing request data across cache lines and causing GC latency spikes. - Propagating
context.Contextand allocator handles clutters business logic signatures.
Goose combines compile-time introspection (const for over fields<T>), data stacks, and StackPage memory regions to deliver identical handler ergonomics with zero GC, zero runtime reflection, and cache locality.