Re: Unboxed structures (yes, again, only this time for real)

Martin Simmons <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
>>>>> On Thu, 15 Jan 2026 15:22:33 +0100, Yuri Davidovsky (as work at disclosure dot ie) said:
> 
> > On 7 Jan 2026, at 21:08, Martin Simmons <[email protected]> wrote:
> > 
> > Structure and CLOS instance slots are always boxed in LW.
> 
> With all due respect, Martin turned out to be wrong on this one.

Your code uses single-float where the 32-bits of data are hidden in the 64-bit
pointer, not allocated on the heap.  You should see a difference if you make
it use double-float.

> And here is the timing results of the custom code with all the performance flags on (10M particles):
> 
> User time    =        0.041
> System time  =        0.000
> Elapsed time =        0.039
> Allocation   = 26544 bytes
> 20 Page faults
> GC time      =        0.000
> 
> These are the results for the native CL structs in LW (also 10M particles):
> 
> User time    =        0.033
> System time  =        0.012
> Elapsed time =        0.044
> Allocation   = 12728 bytes
> 2 Page faults
> GC time      =        0.000

I wouldn't trust any timings that are less than a few seconds.  This is
especially true on hardware where the clock speed varies according to CPU
usage (hence the same code runs more slowly until the speed has ramped up).

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.