A brief note about slot access cost in Common Lisp
Summary
This post analyzes the performance cost of accessing slots in Common Lisp's CLOS, comparing structure objects to standard instances and exploring the Metaobject Protocol. It highlights why instance slot access involves function calls and layout checks, and why SLOT-VALUE can be slower than inlined readers. Benchmarks across multiple CL implementations illustrate that generic function dispatch incurs overhead, with structure access often outperforming instance access.