DigiNews

Tech Watch by Johan Denoyer

← Back to articles

A brief note about slot access cost in Common Lisp

Quality: 8/10 Relevance: 9/10

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.

🚀 Service construit par Johan Denoyer