3 ms·
How do you make optimal use of a computer's memory hierarchy? Do messages allow structural sharing of data? Or is every message assumed to potentially go over t
by amelius 8y ago
How do you make optimal use of a computer's memory hierarchy? Do messages allow structural sharing of data? Or is every message assumed to potentially go over the network, hence destroying opportunities for optimizations (e.g. think of the internal workings of a high-performance database engine).
- dnautics 8y agoIirc the idea here is that there are four very smart engineers working on the core that have taken care of that for you. Everything on top is quite battle tested.
- coldtea 8y ago>How do you make optimal use of a computer's memory hierarchy? Apparently more easily, with a faster time to market, and with less errors than alternative languages. E.g: https://blog.discordapp.com/scaling-elixir-f9b8e1e7c29b https://blog.discordapp.com/scaling-elixir-f9b8e1e7c29b https://www.wired.com/2015/09/whatsapp-serves-900-million-users-50-engineers/ https://www.wired.com/2015/09/whatsapp-serves-900-million-us... But the idea is not that you as the end programmer "make optimal use of a computer's memory hierarchy". It's that you write in a way that makes it easy for the runtime to ensure what you do is solid and correct and scalable -- and it's up for the runtime makers to make sure it makes optimal use of the computer's memory hierarchy. And it's also that you sacrifice some of that "optimal use", to get the "solid and correct and scalable" part.
- toast0 8y agoErlang does have a shared binary type, but the other types are simply copied. This is likely not space efficient, and it likely uses a lot more memory bandwidth. However, this allows for the garbage collection to be extremely simple. It may be pretty useful for NUMA systems as well; although, I'm not sure how well the VM manages that, it may be more potential than actual. Other actor systems may vary.