Skip to content

Comment on Multi-threading is always the wrong design (2023)

Comments

Every time I try to increase the performance of my software by using multiple cores, I need a lot of cores to compensate for the loss of per-core efficiency. Like, it might run 2-3 times as fast on 8 cores.

I'm sure I've been doing it wrong. I just had better luck optimizing the performance per core rather than trying to spread the load over multiple cores.

Or your task needs the overhead to sync and read/write data. Only you can tell really with access to code/data, but 3x speed on 8x cores may well be the theoretical maximum you can do for this specific thing.

Synchronization overhead is more than people think, and it can be difficult to tell when you're RAM/cache-bandwidth limited. But it makes a difference if you can make the "unit of work" large enough.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.