Re: Performance assistance / advice

"David McClain (as dbm at refined-audiometrics dot com)" <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>

> On Mar 11, 2025, at 08:49, Tim Bradshaw (as tfb at tfeb dot org) <[email protected]> wrote:
> 
> This can quite easily be parallelised on a shared-memory machine for large particle numbers (it would be harder on a shared-nothing system since you need to copy the particle state everywhere), and it works very well: it gets basically linear speedup up to the number of fast cores on an M1 machine (which I think is 4).  I'm using lparallel: it would be trivial to do the same using LW's native multiprocessing but I wanted something simple & portable between implementations.


There is another dimension that might be useful here - in addition to lparallel, which executes tasks across a thread pool, you can also gain by using concurrency in parallel. That divides individual tasks into concurrent activities and spreads their execution to any available thread. 

Each particle in your system might also become a self contained Actor in a concurrent system, where each particle is responsible for keeping its own state and responding to messages from interacting other particles. Not sure if this would be an improvement or not. But you can literally have millions of Actors since each is simply a passive functional closure encapsulated in a 1-slot structure, and takes nothing from the underlying multiprocessing system.
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.