Re:Why I Prefer Functional Programming
by kenjackson on Saturday October 31, 2020 @06:04PM
(#24955576)
I think it may be more accurate to say they are both hard problems. It is still open if P=NC.
That is misleading. Although you're technically correct [1], the computational models on which computational complexity classes are based are so abstract and idealized, that they offer almost no information whether your program could make efficient use of an actual, physical 8-core CPU.
The NC complexity class assumes a PRAM machine, in which all processors can access all locations of a central memory in constant time. That's not how a multi-core CPU works in practice: If your parallel algorithm doesn't make proper use of cache-locality, you've already lost.
[1] (the best kind of correct)
That's the main issue which FP-for-parallel-execution proponents don't seem to get: Identifying independent (and therefore parallelisable) computations isn't the hard part, but planning the data layout and partitioning so that all your parallelism isn't eaten up by synchronization and data movement between cores.