4 ms·
Wait - Pure functional languages making lots of copies and lacking side effects is supposed to be a bad thing from a hardware perspective? As I understand it, s
by razorunreal 10y ago
Wait - Pure functional languages making lots of copies and lacking side effects is supposed to be a bad thing from a hardware perspective? As I understand it, synchronising shared memory is a massive source of complexity and stalls in modern processors. You get better performance in multithreaded code when you churn through new memory rather than mutate what you've already got, and even better in a stream processor where you know that is what is going to happen. Still, I suppose that's not a great argument for custom hardware because code that would benefit could most likely be shoehorned onto a GPU. Or maybe that's an argument that GPUs are already pretty close to being the custom hardware that we need.
- smitherfield 10y ago> You get better performance in multithreaded code when you churn through new memory rather than mutate what you've already got My understanding is this is related to aliasing at the software, language or compiler level, not the hardware level.
- qznc 10y ago> synchronising shared memory is a massive source of complexity and stalls in modern processors Correct. > making lots of copies is supposed to be a bad thing from a hardware perspective Yes, because memory accesses are costly. You want your data to be packed tightly in memory instead of chasing pointers all the time. An array is more efficient than a linked list mostly due to caches. The balance is key. You want one copy per core, but not one copy per data update.