Re: struct accessors are not inlined even with declaimations

Daniel KochmaƄski <[email protected]> Wed, 22 Jul 2026 10:52:20 +0200 (CEST)
Newsgroups gmane.lisp.ecl.general
Message-ID <[email protected]>
Hey,

thanks for the report!

coincidentally I've stumbled upon that recently:
https://turtleware.eu/posts/A-brief-note-about-slot-access-cost-in-Common-L=
isp.html
scroll to struct access remarks.

I want to address it after other pressing issues are resolved
(I'm working on accessor dispatch performance and slot-value now).

Best regards,
Daniel


> 22.07.2026 10:33 CEST Qiantan Hong <qthong-FGKo4X94FMn2fBVCVOL8/[email protected]> napisa=C5=82(a):
>=20
>=20
> Hi there,
>=20
>=20
> On Linux x86-64 ECL 26.5.5:
>=20
>=20
> (declaim (optimize (speed 3) (safety 0) (debug 0))) ; to be "safe"
> (declaim (inline point-x))
> (defstruct point (x 0 :type fixnum))
> (declaim (inline point-x)) ; to be safe...
>=20
>=20
> (defun uses-accessor (p) (declare (type point p)) (point-x p))
>=20
>=20
> uses-accessor still generates a FUNCALL after compile-file:
> value0 =3D (cl_env_copy->function=3D(VV[9]->symbol.gfdef))->cfun.entry(1,=
 v1p) /* POINT-X */;
>=20
>=20
> Best,
> k