Re: LW compiler optimizations
"Yuri Davidovsky (as work at disclosure dot ie)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
Thanks, Martin, your response was quite enlightening and explains why we see the difference in performance well. It confirms the suspicion that we collectively came to that displaced arrays are a less preferred option when it comes to numerically intensive code. > On 20 Jan 2025, at 20:07, Martin Simmons <[email protected]> wrote: > > In LispWorks at least, a simple 1d array is a single object, where the data > follows the type information in memory. Displaced arrays are two objects, > because you have the displaced array and the array that it references. That > make aref more complicated. > > There are two additional complications: > > - You can have a chain of multiple displaced arrays, so aref has to loop in > the general case until it reaches the simple array at the end of the chain. > > - In the case of adjustable displaced arrays, the displaced array can be > changed on-the-fly to an array with a different size. We ensure that this > on-the-fly change by adjust-array is thread-safe w.r.t. aref, which makes > aref to more work. > > There is no type declaration to specify either of these complications, so aref > has to assume that any non simple array might be a chain of adjustable > displaced arrays. _______________________________________________ Lisp Hug - the mailing list for LispWorks users [email protected] http://www.lispworks.com/support/lisp-hug.html