News for hackers. Stuff that matters.
Re:José Valim Reveals “Project Nx” (Numerical Elixir) [audio] by bcrosby95 on Tuesday February 09, 2021 @03:40PM (#26082143)
My particular problem was a back end for a medium-level multiplayer RPG (500ish people connected at once per world). The only real way I found to get it performant was to lean heavily into processes. But then you have a race condition problem and need to DIY your own method of synchronization because you're no longer using the process mailbox for that purpose.

In practice I haven't found the immutability of Elixir that useful for concurrency because data is deep copied when it goes across processes anyways. This is in comparison to Clojure where you can safely and perfomantly share immutable data across multiple threads.

Re:José Valim Reveals “Project Nx” (Numerical Elixir) [audio] by dnautics on Tuesday February 09, 2021 @03:52PM (#26082242)
I would have suggested ets tables + entity system.
Re:José Valim Reveals “Project Nx” (Numerical Elixir) [audio] by bcrosby95 on Tuesday February 09, 2021 @05:14PM (#26083112)
From my testing, the performance characteristics of ets isn't that great - data still gets copied around when you access stuff in it. I tried using it in my exploratory tests and certain worst case, player-focused actions would take around 20ms, when using a regular GenServer with a synchronization system on top would take around 5us.

To be clear, for NPCs it worked fine. But players are hoarders and in an RPG that can result in a ridiculous amount of data being attached to them.